SmartGit pulls not as expected

I forked the repository on GitHub.

Then I cloned my plug into a folder on my local development environment via SmartGit. In addition, I added the original repository as a remote.

Now the source repository has added and modified some files. I would like to get them so that I am in the know before proceeding with the development.

I click the Pull button in SmartGit and select the original repo 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 works as expected.

Why doesn't SmartGit pull as I expect?

+7
source share
4 answers

In Pull, SmartGit will do a β€œgit fetch” and then merge accordingly. rebase tracked branch. In your case, master tracks are origin/master , not lm/master . Now you have a choice, always assuming you are on master :

(1) Configure master to track lm/master instead of origin/master : invoke Branch> Branch Manager , select master , call Reset the Tracked branch in the context menu, then add lm/master to the selection and call Install Tracked Branch . Now it is lm/master , which will be merged (or reinstalled) on each Pull .

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

(3) Manually reinstall lm/master : invoke Branch|Rebase , select HEAD for the selected Branch|Rebase , and select lm / master on the graphics page.

+10
source

What I ended up in SmartGit was:

  • Remote > Add (like you). I called mine upstream .
  • In the branches panel Right click upstream > fetch more.. and select the branches. (Usually a 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 branches called upstream that tracks upstream / downstream.
  • In the branch panel Double click Local Branches > Master to return you to the main branch.

At this point, I would suggest that you just split up the project a few moments ago, so the next step will not be very useful, but if there are several additional commits at a later stage, you will need to do this.

  • Remote > Pull and select upstream . If you press the small down arrow, you will see that you can ONLY do "Neither merge nor reinstall." It's good.
  • Click fetch This will allow you to see the entire log and what has changed.
  • In the branch panel Right click Local Branches > upstream > Merge .
  • Fast-Forward if you think you can. (My preferred method).
  • or Create Merge-Commit.

From now on, you will only need to take the last 5 steps. The first steps were only installed.

+7
source

You will see new files if the branch upstream of your current local branch was " lm/master ".
But if you are on master , its branch up by default, of course, defaults to " origin/master " (ie the master your fork)

If you want to merge files from the source repo, fill in your command with

 git merge lm/master 

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

+3
source

if SmartGit performs fetch on each pull,

Then find the branch option in the menu bar or branch window from the application. enter image description here

Then

enter image description here

OR

enter image description here

Voila ... Enjoy

+3
source

All Articles