Pushing a git branch

Tags: django

We’re using git for most django projects now. There’s one big problem I had: if I make a branch and want to push my changes to github, I sometimes get an error complaining that I’m behind on other branches so that my changes can’t be pushed.

The “solution” is to do a git checkout master, pull there (which updates my master pointer), and checkout back to my branch. Now I can push.

This is pretty irritating. Why can’t I just push the branch I’m working on? I found the solution on stackoverflow:

git config --global push.default current

This pushes only the current branch by default. Just what I wanted.

 
vanrees.org logo

Reinout van Rees

My name is Reinout van Rees and I program in Python, I live in the Netherlands, I cycle recumbent bikes and I have a model railway.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):