tags:

views:

107

answers:

2

When I'm on master, I only have to type 'git push' to push commits to the remote repo. I wish I could do so when I'm on another branch, without specifying the remote name and the branch name. Like that:

Now: git push origin experimental:origin/experimental

Need: git push

+9  A: 

You should edit your .git/config file. There should be already set something like this:

[branch "master"]
    remote = origin
    merge = refs/heads/master

Simply copy the group and edit according to your needs. For example, you could have:

[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "experimental"]
    remote = origin
    merge = refs/heads/experimental
Damir Zekić
Clear and concise answer. +1
Abizern
A: 

Also, have a look at this answer on how to achieve that from the command line.

Lernkurve