How do I get the current branch name in Git?

Question

How do I get the name of the current branch in Git?

Answer

To display only the name of the current branch you're on:

git rev-parse --abbrev-ref HEAD

Reference: Show just the current branch in Git

Is there a git-merge --dry-run option?

There is no tracking information for the current branch