Hasan Setiawan

Write, write, write give your wings on code!

Follow me on GitHub

Git Delete Branch

You want to delete stale branch

              
                $ git branch -d branch_name
                $ git push origin --delete branch_name
              
            

Delete Local Branch

To delete the local branch use:

              
                $ git branch -d branch_name
              
            

Note: The -d option is an alias for --delete, which only deletes the branch if it has already been fully merged in its upstream branch. You could also use -D, which is an alias for --delete --force, which deletes the branch "irrespective of its merged status." [Source: man git-branch]