I have file committed into my local Git branch. This file is maintained by many designers. Now I want to pull the other designers updates, to merge with my local ones and to push merged version in the future.
I make eg pull
. I am used to SVN, where it caused automatic merge or proposition to resolve. Here nothing happens. I see the local file is still my local branch committed copy.
How to do what I want?

- 85
- 1
- 3
- 11
-
Are you pulling from the correct branch? Maybe, try to specify the branch you are pulling from with `git pull origin branch-name`. – lema Mar 19 '20 at 10:08
-
Also, could you add the output of the console after running `eg pull`? – lema Mar 19 '20 at 10:09
-
I am sure I don't pull from my own fork. I can see many files with other's updates were successfully pulled. Only the file which is submitted to my local branch isn't merged with other's updates get by pull. The output of the console (after multiple pulls):{228}rg1user02../ws_active5_roc_net_nixrx >eg pull Starting pull operation Fetching eg_projects repo Fetching eg_ip repos Analyzing workspace... Synchronizing links in 2 project run directories... (1/2) Project 'ccdev' sync complete (2/2) Project '10x' sync complete Pull from origin complete – chainastole Mar 19 '20 at 13:38
3 Answers
I think git pull <remote> <branch>
would help you to get all the changes from upstream and will automatically merge them into your code. If there are no merge conflicts, then the process is smooth and you may think that nothing happened. But, as you said that the file remains the same, maybe you are pulling from the branch or maybe even pulling from your own remote, i.e. your own fork.
Do a git remote -v
to see the remotes, I think the fetch remote must be your own fork. To add the main repository as a remote, do:
git remote add <remote-name> <url>

- 883
- 8
- 16
-
I am sure I don't pull from my own fork. I can see many files with other's updates were successfully pulled. Only the file which is submitted to my local branch isn't merged with other's updates get by pull. – chainastole Mar 19 '20 at 13:36
Using git pull
does merge the files, you might have to deal with some merge conflicts, though. This means that pull not only downloads new data; it also directly integrates it into your current working copy files.
If you just want to fetch the files without merging them, use git fetch
which really only downloads new data from a remote repository - but it doesn't integrate any of this new data into your working files
For a more in-depth discussion

- 2,872
- 2
- 32
- 37
Seems I know the problem. This is the way how local updated file was generated. It wasn't updated naturally on the basis of pulled version. It was copied from external location over pulled version. Therefore apparently git doesn't think there is something to merge. It just thinks my local file is better.

- 85
- 1
- 3
- 11