SmartGit pull not acting like expected
Asked Answered
A

4

7

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?

Appellate answered 8/5, 2012 at 9:2 Comment(2)
I'm assuming you are using SmartGit 3.0.x. When opening the Log and using Graph|Select Branch to show "All branches", can you see the other commits? What does Branch|Branch Manager show for Local Branch "master"?Waltraudwaltz
@Waltraudwaltz After pulling, the log does show the commits, but the changes aren't pulled. The branch manager looks like this: postimage.org/image/qpp3mgu1xAppellate
W
11

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.

Waltraudwaltz answered 8/5, 2012 at 10:11 Comment(1)
Looks quite SmartGit-detailed. +1Drice
C
8

What I ended up doing in SmartGit was:

  • Remote > Add (as you did). I called mine upstream.
  • In the branches panel Right click upstream > fetch more.. and select the branches. (Typically master)
  • In the branches panel Double click upstream > master. This will ask you to create a 2nd branch (usually master-2). I also called this upstream. So I have a remote repo called upstream and local branch called upstream that tracks upstream/master.
  • In the branches panel Double click Local Branches > Master to get you back to your master branch.

At this point I would presume you only just forked the project a few moments ago, so this next step would not be very useful, but if there are a few extra commits at a later stage you will need to do this.

  • Remote > Pull and select upstream. If you press the little down arrow, you will see you can ONLY do "Neither merge nor rebase". This is good.
  • Click fetch This will allow you to see all the log and what has changed.
  • In the branch panel Right click Local Branches > upstream > Merge.
  • Fast-Forward if you believe you can. (My preferred way).
  • or Create Merge-Commit.

From this point on, You would only have to do is the last 5 steps. The first steps were just setup.

Complement answered 29/5, 2013 at 9:41 Comment(0)
D
3

You would see the new files if the upstream branch of your current local branch was "lm/master".
But if you are on master, its upstream branch is certainly by default "origin/master" (ie the master of your fork)

If you want to merge the files from the original repo, complete your command with a

git merge lm/master

Or, in SmartGit, merge from lm/master to your current branch.

Drice answered 8/5, 2012 at 9:45 Comment(2)
This doesn't answer my question. The problem is not pulling from the Git Bash, but pulling from SmartGit.Appellate
@Appellate Sure, I have edited the answer, but basically what you want to do is a merge after your SmartGit pull. And SmartGit allows you to do that. My point was to explain why you had to do an extra operation (be it through your GUI or the bash) in order to see the files.Drice
I
3

if SmartGit is performing Fetch on your every Pull,

Then locate the branches option in menu bar or branches window from the application.. enter image description here

Then

enter image description here

OR

enter image description here

Voila... Enjoy

Intrepid answered 5/3, 2014 at 6:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.