---
title: Push the current Git branch, even if you've never pushed it before
teaser: A configuration setting for better git pushes.
tags: git
author: Gabe Berke-Williams
published_on: 2011-09-14
---

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]
    # Push current branch even if you've never pushed it before
    default = current

You might want to take a look at my
[gitconfig](https://github.com/gabebw/dotfiles/blob/master/gitconfig) for more
tips.
