Carlos Ferreira
Carlos Ferreira

Reputation: 432

Sync git repo when i have simultaneous incoming and outgoing commits

I'm using Visual Studio 2015 and i have a VS Project on a git repo in Visual Studio Team Services (was Visual Studio Online).

Every time i have incoming commits and outgoing Commits (simultaneously), if i make a pull request, i get the error message:

Cannot pull because there are uncommitted changes. Commit or undo your changes before pulling again. See the Output window for details.

If i try to do a commit, i get the following error:

You cannot push branch develop to remote origin because there are new commits in the remote repository’s branch. Pushing this branch would result in a non-fast-forward update on the branch in the remote repository.

So i hit the wall and get stuck everytime i have a similar situation:

State of Team Explorer when i have issues

Unable to pull

Unable to push

I tried the command line but so far it made me lose work (mostly due to my lack of experience in git).

Is there any way to solve this though Visual Studio ? If not, what's the best approach on this type of situation ?

Upvotes: 2

Views: 12673

Answers (1)

Daniel Mann
Daniel Mann

Reputation: 59016

You have to commit your changes to your local repository, then pull the changes from the remote. After you do merging/conflict resolution, you'll be able to push your changes.

Upvotes: 1

Related Questions