Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » New to Git and EGit, a few questions
icon5.gif  New to Git and EGit, a few questions [message #646266] Wed, 22 December 2010 19:12 Go to next message
Andre John Mas is currently offline Andre John Mas
Messages: 11
Registered: July 2009
Junior Member
The team I working with is in the process of migrating to GIT, but there seems to be stuff we are not quite understanding, since we often run into issues where we can't do a push (action refused, but no further explanation) even though we have done a fetch.

My local repository has two branches, the master and one for myself. What I am wanting to understand is how the work flow in EGit should be. For example if I make a change in my branch I make a commit, from there should I be:
- merging to the local master and then pushing to
or:
- pushing the changes from my branch directly to the remote master

Is there a good explanation somewhere of how the workflow between a local branch and the remote repository operates?

Currently using EGit 0.9.3

[Updated on: Wed, 22 December 2010 19:12]

Report message to a moderator

Re: New to Git and EGit, a few questions [message #646307 is a reply to message #646266] Thu, 23 December 2010 04:37 Go to previous message
Matthias Sohn is currently offline Matthias Sohn
Messages: 491
Registered: July 2009
Senior Member
Fetch only updates remote tracking branches and does not modify your local branches. If you want to update local branches with changes from an upstream repository either run fetch then merge or rebase or use pull which is fetch + merge.

Your local master branch doesn't really matter, it's not special in any regards, it's just a local branch which is created automatically after clone for your convenience so that you don't need to first create a local branch before you can start doing commits. So you can directly push from your local branch to the remote branch you are shooting for (if you have write access to upstream). If you don't use the force flag push will reject non-fast-forward pushes [1]. Push does not attempt to merge on the receiving end of the transport. So usually you then fetch the new changes from upstream using fetch and then either merge or rebase your work with these changes and then push the result of this operation again (can be done using pull or pull --rebase, the latter is not yet supported by egit).

I would recommend to update to egit 0.10 as 0.9 didn't show errors occurring on push operation.

[1] see "Notes about fast-forwards" in http://www.kernel.org/pub/software/scm/git/docs/git-push.htm l
Previous Topic:Feedback on 0.10
Next Topic:gitweb & eclipse (moving the .git folder to public_git)
Goto Forum:
  


Current Time: Wed Apr 16 03:28:53 EDT 2014

Powered by FUDForum. Page generated in 0.03030 seconds