I'm working with the Git plugin for Eclipse. To update my working directory, I used to do a Pull or a Fetch+Merge. When there is a conflict to resolve, I use the merge tool. But recently I tried a new approach.
To see what have been changed by others, I do a Fetch and after that, a Synchronise Workspace. If I try to do a commit and push after updating my code directly within the team synchronise view, I've got the "rejected-non-fast-forward" error.
I want to know if I can update my working directory using the team synchronise view or if the only way to do that it's via the merge action of Egit.
You can use the Synchronize workspace function to gather changes made, but not yet commit those changes. To check if there are updates on a shared project: In Mapping Services workspace, right-click a shared project. In the pop-up pane, click Team > Synchronize workspace as shown in the following graphic.
Right click on my project -> Team -> Synchronize Workspace. This opens "Team Synchronizing" perspective.
Committing a Change to the Eclipse.org server To do the local commit, select the file, right-click menu, Team -> Commit. 2) To push them back to the server, you need to "Push to Upstream". You can only push to upstream at the project/repo level. You can't push an individual file, like you can in CVS.
"Synchronize workspace" and the team perspective are just other ways to display the changes. Both do not modify the underlying git workflow. You always have to merge incoming changes before committing your changes, when pushing to a shared repository.
However, if you always just want incoming changes to be merged with your own local changes, then you might want to have a look at the "rebase" pull strategy of your local branch. That basically temporarily removes your own changes, pulls the remote changes into your branch and re-applies your own local changes. You will still have to resolve merge conflicts, if they occur.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With