1

I'm new to Git version controlling. I use EGit plugin with eclipse which again I haven't used before.

My question is, I have created a project (on PC1) in eclipse that is connected with a remote repo which is hosted on Github. I can commit and push them to the remote repo using EGit plugin via eclipse.

If I work on the same remote repo from another computer, say PC2 and i have made some changes to the repo from PC2, how can I sync my code on PC1 with the remote repo and see the changes visually?

if I go to Team -> i can see Synchronize Workspace but that is not what I want and again I don't understand the purpose of it as well (have attached a pic)? enter image description here

If I goto Team -> Merge.. below is what I see. It doesn't give me the option to merge with the remote repository and see? enter image description here

samsamara
  • 4,630
  • 7
  • 36
  • 66
  • The [eGit documentation](https://wiki.eclipse.org/EGit/User_Guide/Remote#Pulling_.28merge_or_rebase.29_new_changes_from_upstream) seems to imply that you have to manually do a `git pull` from the Git bash window. This will solve your problem, although there might also be a way to do using the Eclipse plugin. – Tim Biegeleisen Oct 05 '15 at 04:35
  • thanks for the comment. But the page says, This page was last modified 10:37, 21 May 2010 . so I guess this is function has been implemented by now – samsamara Oct 05 '15 at 04:42
  • The option you want is `git pull`. Check the screen for this option. – Tim Biegeleisen Oct 05 '15 at 04:51
  • yes it says git pull. but can I do that without using the terminal? – samsamara Oct 05 '15 at 04:59
  • as said in this page: http://wiki.eclipse.org/EGit/User_Guide#Synchronize_View , " resources in your workspace or a local branch compared to those in another local or remote tracking branch representing the state of a branch from a remote repositor" – samsamara Oct 05 '15 at 05:02
  • 1
    @TimBiegeleisen found the answer. JLYK. thanks – samsamara Oct 05 '15 at 05:36

1 Answers1

1

Ok so I found the answer. you have to add the following line to the config file under .git

add following to the [remote "origin"] section:

fetch = +refs/heads/:refs/remotes/origin/

Thanks to the answer in this post: EGit: cannot push, cannot pull

Community
  • 1
  • 1
samsamara
  • 4,630
  • 7
  • 36
  • 66