Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update my git working directory via EGit with Synchronise Workspace

Tags:

eclipse

egit

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.

like image 279
naike Avatar asked Apr 24 '13 09:04

naike


People also ask

What is synchronize workspace in Git?

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.

When selecting the Synchronize Workspace option for a project what perspective is opened?

Right click on my project -> Team -> Synchronize Workspace. This opens "Team Synchronizing" perspective.

How do I push changes in Eclipse?

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.


1 Answers

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

like image 192
Bananeweizen Avatar answered Sep 21 '22 11:09

Bananeweizen