Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Indicator that upstream branch has updated?
Indicator that upstream branch has updated? [message #937097] Mon, 08 October 2012 16:58 Go to next message
D Z is currently offline D ZFriend
Messages: 1
Registered: October 2012
Junior Member
Hi,

I've tried searching, but I can't find an answer to this question:

Does EGit indicate which projects' repos have upstream updates to the branch you currently have checked out? In other words, if my local git repo is a clone from GitHub (and so I have tracking branches), will I get an indicator that tells me visually that GitHub has been updated and that I need to fetch if I want to be in sync?

Sorry for being clueless -- All I really want is easy in-eclipse notifications, and I'm wondering if EGit can help me or not. Thanks for any reply.

-- DZ
Re: Indicator that upstream branch has updated? [message #937229 is a reply to message #937097] Mon, 08 October 2012 20:09 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
EGit provides a visual decoration if the active branch is behind and/or ahead of the branch or reference it's tracking (it can of course be both behind and ahead simultaneously). The decoration is an up-arrow+count for the number of commits ahead, and down-arrow+count for the number of commits behind. This works for all tracking branches, whether what's being tracked is a remote-reference or a local branch (the status decoration for local branch tracking is relatively new).

In that way it behaves like "git status" on the command-line. But also like "git status", when tracking a remote-reference it relies on the local state of that reference. To ensure that the remote-reference is current with the remote repository you must do a fetch. As far as I know that's true both in Git and EGit. Keep in mind that fetch does not do anything with your working tree or index. All it does is copy commits and update remote-references.

So the short answer to your question is: do a fetch and EGit will update the decorations accordingly.

If you're looking for the Git equivalent of 'hg in' in Mercurial or 'svn status -u' in Subversion, I don't think it exists in Git (or EGit). It isn't necessary, given Git's remote-reference concept, which neither SVN nor Mercurial has.

Re: Indicator that upstream branch has updated? [message #937949 is a reply to message #937229] Tue, 09 October 2012 12:03 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 612
Registered: July 2009
Senior Member
The other prerequisite of this decoration is that the currently checked out branch needs to track another branch [1]. This tracking relationship is established automatically if you select a branch and click "Create Branch...", the dialog which comes up allows to choose the branch to track in case there are multiple branches pointing to the same commit and to configure the merge strategy.

[1] http://git-scm.com/book/ch3-5.html#Tracking-Branches
Previous Topic:Egit "clean"?
Next Topic:EGit https clone
Goto Forum:
  


Current Time: Thu Nov 27 23:43:58 GMT 2014

Powered by FUDForum. Page generated in 0.06600 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software