Push the current git branch, even if you've never pushed it before

The first time you push a git branch to a remote, you have to be explicit the first time:

git push origin my-branch-name

Every time after that, a simple git push will work fine. But there’s a ~/.gitconfig setting that will let you just git push without needing that initial explicitness:

# Push current branch even if you've never pushed it before
default = current

You might want to take a look at my gitconfig for more tips.

Goal-Oriented Git book cover

Goal-Oriented Git is our practical, no-nonsense guide to using Git to achieve your goals in everyday situations. If you've ever wanted to improve your Git skills without getting distracted by complex internals, then this book is for you.