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
- 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?
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 . 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.