Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
Description
There is some confusion around the default behaviour of pushing a branch in git, compared to the pull tracking behaviour.
Tracking a remote branch in Git actually just means where you pull from. When pushing that branch with no specifics, it is assumed to be pushed to a branch of the same name on the remote, unless you configure 'remote.origin.push' to be something else (this is common for people who push via code review systems or deployment systems).
Some people, especially those new to git might expect that if they chose to track a different branch, push would go back to that branch too (it doesn't). We can't change this default globally because it would be unexpected to git veterans. However, there should be some way we can make this more obvious or controllable. Options might include:
- When tracking a branch, if it's not the same name ask if the push option should be set too. However since push can be different per remote rather than just a single entry like pull tracking, this might be oversimplified.
- Have an extra section in the remote configuration where you specify the push behaviour.
Git themselves may be changing the default behaviour: http://lwn.net/Articles/487131/ It is worth seeing what the outcome of this is before implementing any changes in SourceTree.