Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » How to fetch changes from master repository?(Newbie question about fetching from github master)
How to fetch changes from master repository? [message #704531] Thu, 28 July 2011 14:57 Go to next message
Dmitry Katsubo is currently offline Dmitry Katsubo
Messages: 5
Registered: November 2010
Junior Member

Dear EGit community,

Sorry if my question is trivial, but I really need your help.


  • I have forked the github repository https:/github.com/cdk/cdk as https:/github.com/dmak/cdk
  • I have checked out my fork as "origin" with ref specs "refs/heads/master:refs/remotes/origin/master"
  • I have made certain modifications in my local repository.
  • Now I want to merge all changes from master repository. For this I have added new remote "master" with ref specs "refs/heads/master:refs/remotes/master/master" (am I doing this right if I wand to fetch from master, but push to origin?)
  • When I invoke "Fetch" from remote master, EGit shows the empty window with fetch results (perhaps I did it several times, so ).
  • When I invoke "Merge" on "master/master" branch, I am shown the "Merge Result" window with two identical entries (why they are the same??). When I lick on OK, nothing happens.
  • However, when I select "Compare with" → "HEAD revision" for some source files, I see that they are different from HEAD.


How can I pull all changes up to "5801b1e5..."? Maybe I miss the trivial button "apply all fetched changesets?" (I haven't found anything so far in http:/wiki.eclipse.org/EGit/User_Guide).

Please, help.

Also I would be pleased if somebody gives a hint, why "master" is shown green on screenshot, "master/master" is grey and "HEAD" is white?
Re: How to fetch changes from master repository? [message #705074 is a reply to message #704531] Fri, 29 July 2011 07:58 Go to previous messageGo to next message
Stefan Lay is currently offline Stefan Lay
Messages: 340
Registered: July 2009
Senior Member
> Now I want to merge all changes from master repository. For this I have added new
> remote "master" with ref specs "refs/heads/master:refs/remotes/master/master" (am
> I doing this right if I wand to fetch from master, but push to origin?)

Yes, that's a good practice to create a new remote where you can fetch from.

> When I invoke "Fetch" from remote master, EGit shows the empty window with fetch
> results (perhaps I did it several times, so ).

I did the same as you and found out that the reason is that there was no new commit on https:/github.com/cdk/cdk between the time you cloned and the time you fetched, your repo already contains commit 5801b1e5.

> When I invoke "Merge" on "master/master" branch, I am shown the "Merge Result"
> window with two identical entries (why they are the same??). When I lick on OK,
> nothing happens.

This seems logical to me if nothing has changed on master and your local changes already have the latest change form master as ancestor in the history.

> However, when I select "Compare with" → "HEAD revision" for some source files, I
> see that they are different from HEAD.

HEAD points to the currently checked out commit. What do you have checked out when you do that? If there are differences, this means that your working directory has non-committed changes.

> How can I pull all changes up to "5801b1e5..."? Maybe I miss the trivial button
> "apply all fetched changesets?" (I haven't found anything so far in
> http:/wiki.eclipse.org/EGit/User_Guide).

What you do is correct: First fetch from master and then merge into your local master. But in the current situation there are no new changes in the master branch of the master repo.

> Also I would be pleased if somebody gives a hint, why "master" is shown green on
> screenshot, "master/master" is grey and "HEAD" is white?

master is a local branch, master/master is a so-called remote tracking branch. HEAD is a reference. You may have a look at the chapter "Remote Branches" in http://progit.org/book/ch3-5.html

Stefan
(no subject) [message #705134 is a reply to message #704531] Fri, 29 July 2011 07:58 Go to previous messageGo to next message
Stefan Lay is currently offline Stefan Lay
Messages: 340
Registered: July 2009
Senior Member
> Now I want to merge all changes from master repository. For this I have added new
> remote "master" with ref specs "refs/heads/master:refs/remotes/master/master" (am
> I doing this right if I wand to fetch from master, but push to origin?)

Yes, that's a good practice to create a new remote where you can fetch from.

> When I invoke "Fetch" from remote master, EGit shows the empty window with fetch
> results (perhaps I did it several times, so ).

I did the same as you and found out that the reason is that there was no new commit on https:/github.com/cdk/cdk between the time you cloned and the time you fetched, your repo already contains commit 5801b1e5.

> When I invoke "Merge" on "master/master" branch, I am shown the "Merge Result"
> window with two identical entries (why they are the same??). When I lick on OK,
> nothing happens.

This seems logical to me if nothing has changed on master and your local changes already have the latest change form master as ancestor in the history.

> However, when I select "Compare with" → "HEAD revision" for some source files, I
> see that they are different from HEAD.

HEAD points to the currently checked out commit. What do you have checked out when you do that? If there are differences, this means that your working directory has non-committed changes.

> How can I pull all changes up to "5801b1e5..."? Maybe I miss the trivial button
> "apply all fetched changesets?" (I haven't found anything so far in
> http:/wiki.eclipse.org/EGit/User_Guide).

What you do is correct: First fetch from master and then merge into your local master. But in the current situation there are no new changes in the master branch of the master repo.

> Also I would be pleased if somebody gives a hint, why "master" is shown green on
> screenshot, "master/master" is grey and "HEAD" is white?

master is a local branch, master/master is a so-called remote tracking branch. HEAD is a reference. You may have a look at the chapter "Remote Branches" in http://progit.org/book/ch3-5.html

Stefan
Re: How to fetch changes from master repository? [message #714880 is a reply to message #705074] Thu, 11 August 2011 12:42 Go to previous message
Dmitry Katsubo is currently offline Dmitry Katsubo
Messages: 5
Registered: November 2010
Junior Member

Stefan, thanks for your comments.

Stefan Lay wrote on Fri, 29 July 2011 07:58
I did the same as you and found out that the reason is that there was no new commit on https:/github.com/cdk/cdk between the time you cloned and the time you fetched, your repo already contains commit 5801b1e5.

Well, I've cloned master repository https:/github.com/cdk/cdk long time ago, but indeed the local repository reports that the changes from master are in my repository, but why the merge result in not in my outgoing list of changesets?

Quote:
This seems logical to me if nothing has changed on master and your local changes already have the latest change form master as ancestor in the history.

Finally I've decided to start all over again (sorry, Git is blowing my mind). I've check out my clone (https:/github.com/dmak/cdk), added the remote repo, and invoked "Merge" on master/master. It was reported that merge worked OK. I am still in confusion: I see no outgoing changes. Does it mean, that my clone is connected to mater in a way, that I do not need to push back all changesets? So when I'll start committing, git will automatically link my commits as coming on the top of all fetched changesets (is it what "parent changeset" used for)?

Quote:
If there are differences, this means that your working directory has non-committed changes.

That was the case. Thank you. On some reason I messed the things... If my above assumption is true, then I won't need validol.
Previous Topic:copy SHA to clipboard
Next Topic:Newbie question: "refresh" projects after eclipse update?
Goto Forum:
  


Current Time: Thu Aug 28 09:14:46 EDT 2014

Powered by FUDForum. Page generated in 0.02220 seconds