Is "Push commits immediately" working fine when a local branch is tracking a remote branch with a different name?

Ramiro Sánchez November 4, 2013

Hello,

Maybe I am wrong and this is the desired behavior, but I think the "Push commits immediately to" is not working fine when you have a local git branch tracking a remote branch with a different name.

In this case when you commit ant check the "Push commits immediately to" I was expecting that my commit will be pushed to the followed remote branch (remember with a different name than the local one), but instead a new remote branch is created with my local name at origin. Is this the expected behavior or is this a bug?

Thanks,

Ramiro

2 answers

1 accepted

0 votes
Answer accepted
XaeroDegreaz July 29, 2014

I've recently started renaming my local branches to be more descriptive of which issue I'm tracking. When you commit, and then use the "Push immediately to..." function, it wants to create a remote branch with the same name. This is quite bad, as it has completely made me look like a noob the past couple days as I was committing away without first checking.

If you right-click on the branch in the sidebar, you can select the "Push to [...] (tracked)" option. It seems pretty inconsistent. At the very least there should be another checkbox in the commit window that allows us to choose to push to the tracked branch, or a branch named the same as our local branch.

To fix the issue so that the commit window always uses your tracked branch, you can go to

Preferences > Git > Set "Push branches" to "upstream"


Ramiro Sánchez August 4, 2014

This solves the problem.

I noticed also (at least now, not sure if this was also true with the latest sourcetree version when I posted the question) that you can be sure before the commit where the changes will be pushed because the message near the checkbox tells you...

Push changes immediately to branchName

And you can see that branch name changes from your local one to the remote one when changing the configuration like xaero indicated.

Thank you very much.

0 votes
victoraldecoa January 2, 2014

It is not working fine. For sure the most intuitive behavior is to push immediately to the tracked branch instead of creating another branch with the same name.

It's a very annoying bug indeed.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events