Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • -d , --delete : Delete a branch.
  • -D : Shortcut for --delete --force.
  • --create-reflog : Create the branch’s reflog. 
  • -f , --force :  Reset <branchname> to <startpoint>, even if <branchname> exists already. Without -f, git branch refuses to change an existing branch.
  • -m , --move :Move/rename a branch and the corresponding reflog.
  • -c ,--copy     :Copy a branch and the corresponding reflog.
  • -l , --list         :List branches. With optional <pattern>..., e.g. git branch --list 'maint-*', list only the branches that match the pattern(s).
  • -a , --all        :List both remote-tracking branches and local branches. Combine with --list to match optional pattern(s).
  • --show-current : print the name of the current branch. In detached HEAD state, nothing is printed.

Example:

creating a new git branch called “dev”

$ git branch dev
Deleted branch dev
$ git branch -d dev

merge

Merges [branch] into current branch.

...