Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Using Synchronize(How to change repository in sync view)
Using Synchronize [message #1809085] Mon, 08 July 2019 17:54 Go to next message
Dennis Putnam is currently offline Dennis PutnamFriend
Messages: 30
Registered: December 2017
Member
I have several repositories but am working in one. I want to view changes to the current source and compare with the remote repository, before doing a commit. I am trying to use the synchronize perspective but the wrong repository is being used. I cannot find any menu item that lets me change the repository in that view. What am I missing? TIA.
Re: Using Synchronize [message #1809088 is a reply to message #1809085] Mon, 08 July 2019 19:35 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 617
Registered: July 2009
Senior Member
I would think what you want to do is compare the code in your current branch with the code in another branch, or a particular commit. You don't need to compare against a remote repository, just ensure that your local branches are up to date (choose "Fetch from Upstream" from repository context menu).

Doing this comparison is easy to do on individual files. Just right-click and select "Compare With..." and select what you want to compare to. I've often wondered how to do this for a directory tree or an entire repository. It's straightforward from the git command line, but I don't know how to do that specific task from Eclipse.
Re: Using Synchronize [message #1809089 is a reply to message #1809088] Mon, 08 July 2019 19:52 Go to previous messageGo to next message
Dennis Putnam is currently offline Dennis PutnamFriend
Messages: 30
Registered: December 2017
Member
I'm trying to compare my current uncommitted changes to the remote master branch. Essentially I forgot where I left off and need to see where I am with my changes. I guess I will have to use CLI rather than Eclipse. Thanks for the reply.
Re: Using Synchronize [message #1809091 is a reply to message #1809089] Mon, 08 July 2019 20:06 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 617
Registered: July 2009
Senior Member
If your changes are uncommited, then just compare to HEAD.
Re: Using Synchronize [message #1809095 is a reply to message #1809091] Mon, 08 July 2019 22:44 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1105
Registered: July 2009
Senior Member
There is no way using standard git commands to compare local commits with commits on the server directly, this is always done in the local repository.
The remote tracking branches (origin/master etc.) reflect the state of branches on the server they had when you ran the last fetch command.

- select remote tracking branch origin/master in the Git repositories view
- click "Synchronize with Workspace"
- configure options under "Preferences > Team > Git > Synchronize" and view options
in the view menu (click triangle in top right corner) in the Synchronize View

Ensure that you either fetch updates manually from the upstream server or configure synchronize to do this automatically.
Previous Topic:Difference between EGit and SourceTree
Next Topic:Unable to connect to GITLAB or even clone a git repository(HTTPS) using eclipse LUNA 4.4.2
Goto Forum:
  


Current Time: Mon Dec 09 14:59:59 GMT 2019

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

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

Back to the top