SmartGit pull not acting like expected

Repox picture Repox · May 8, 2012 · Viewed 7.2k times · Source

I forked a repository on GitHub.

I then cloned my fork into a folder on my local development enviroment through SmartGit. Additionally I added the original repository as a remote.

Now, the original repository has added and changed some files. I'd like to retrieve these so that I'm up to date, before continuing with developing.

I the push the Pull button in SmartGit and select the original repo i the dialog. SmartGit returns this to me:

remote: Counting objects: 24, done.
remote: Total 13 (delta 7), reused 12 (delta 6)
From github.com:Original/repo
 * [new branch]      master     -> lm/master

But, the added files and changes are not added to my local repository. Doing this manually with Git Bash - git pull original master everything works like expected.

Why is it SmartGit doesn't pull like I expect?

Answer

mstrap picture mstrap · May 8, 2012

On Pull, SmartGit will perform a "git fetch" and after that merge resp. rebase the tracked branch. In your case, master tracks origin/master, not lm/master. You have following choices now, always assuming you are on master:

(1) Configure master to track lm/master instead of origin/master: invoke Branch|Branch Manager, select master, invoke Reset Tracked Branch from the context menu, then add lm/master to the selection and invoke Set Tracked Branch. Now, it's lm/master which will be merged (or rebased) on every Pull.

(2) Manually merge lm/master: invoke Branch|Merge and select lm/master.

(3) Manually rebase onto lm/master: invoke Branch|Rebase, select HEAD to selected commits and on the graph-page, select lm/master.