Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » EGit Work on a Branch, Commit, Switch and Pull remote master(Suggestion on EGit Workflow for Eclipse Contributors: how to work on Branch, Commit, Switch and Pull remote master)
EGit Work on a Branch, Commit, Switch and Pull remote master [message #1693556] Sat, 25 April 2015 07:32 Go to next message
Patrik Suzzi is currently offline Patrik SuzziFriend
Messages: 2
Registered: February 2018
Junior Member
I'm working on an Eclipse bug, and I'm using Git as SCM.

This is my situation:


  • I pulled remote master three days ago
  • I created a new local-bug-branch and I started working on this new local branch
  • I never did any commit in the last three days, so my changes are still Unstaged


now I want to

  • commit my changes on local-bug-branch
  • switch to master and pull latest updates
  • rebase my local-bug-branch to the latest updates I pulled from remote.


I think this is how I'm supposed to proceed

  • commit changes on my local-bug-branch
  • switch to my local master branch
  • pull remote updates from remote master to local master
  • switch to my local-bug-branch again
  • rebase my local-bug-branch on local master (since the local master is now updated).


So below there are my questions:

  • Q1 : Is the workflow I described the correct workflow ?
  • Q2 : Do you have any suggestions on which is "the correct" workflow ?

Cheers.
Re: EGit Work on a Branch, Commit, Switch and Pull remote master [message #1693618 is a reply to message #1693556] Sun, 26 April 2015 20:34 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
the easiest way to achieve what you want is:
* fetch updates from the server, this fetches new commits and updates remote tracking branches if there are any new commits on the server
* if all your changes are still uncommitted just try to create and checkout a new local branch on the remote tracking branch you are aiming for, if the updates from the server didn't touch the files you touched locally this should work
* then commit your local changes
* otherwise just commit them on the local branch you already have and then rebase that on the remote tracking branch you are aiming for

I almost never use pull since in most cases it requires a clean local state, instead I prefer to fetch updates to first see what I get from the server
before I decide what to do about the new commits and updated branches.
Re: EGit Work on a Branch, Commit, Switch and Pull remote master [message #1699212 is a reply to message #1693618] Mon, 22 June 2015 15:45 Go to previous message
Patrik Suzzi is currently offline Patrik SuzziFriend
Messages: 2
Registered: February 2018
Junior Member
It took me a while, but now I see the risks related to pull.

Thank you very much for the suggestion.
Patrik
Previous Topic:Missing history
Next Topic:Garbage collection concurrency with ref update
Goto Forum:
  


Current Time: Thu Apr 25 10:14:23 GMT 2024

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

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

Back to the top