
You’ll use the git push command along with the -d flag to delete. To delete a remote branch, you will simply right-click on the target branch from the central commit graph or the left panel and then select Delete
'refs/remotes/origin/dev’, but not yet merged to HEAD.ĭeleting a remote branch is quite different. NOTE: This must be placed between remote and subcommand. Whether you use GitFlow, GitHub Flow or any other branch driven development strategy, you will inevitably end up with a local Git repository filled with branches you no longer need. For promisor remotes, also show which filter ( blob:none etc.) are configured.

OPTIONS -v -verbose Be a little more verbose and show remote url after name. However, git will allow you to delete an unmerged local branch if it exists remotely: warning: deleting branch ‘dev’ that has been merged to DESCRIPTION Manage the set of repositories ('remotes') whose branches you track. If you are sure you want to delete it, run 'git branch -D dev’.Īs the error message informs, you can force deletion with the -D flag. Therefore, git will refuse to delete a branch in such a situation, by default: error: The branch ‘dev’ is not fully merged. If you delete a branch that only exists locally, with unmerged changes, you’ll lose those changes. When things go right, you’ll see a confirmation message: Deleted branch dev (was 1ae41e8). But what does origin mean when used where one would expect the name of a branch git returns all the commits that ntd-dev has that origin does not have.

the repo to which branches are pused if the push does not explicitly specify which repo to push to. You can’t delete the branch that is currently active if you try to do so, you’ll get a message like this: error: Cannot delete branch 'main' checked out at '/tmp/sandbox' I know that the word origin is used by git as the default alias for the remote repository, i.e. The simplest form of the command deletes a local branch, providing all its changes have been merged: $ git branch -d dev
