Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Sync Git in Visual Studio 2013

I'm working with another developer and we seem to have got ourselves into a GIT pickle. I commit code regularly and regularly push to the remote master. My colleague (whilst a great guy and developer) has not got into the habit of doing this and when I went to Pull the Head revision this morning (as is my habit), I was faced with the following error message:

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

I then noticed there were 5 incoming commits dating back to 5 days earlier. I have no local commits at all and no staged changes.

I've tried Sync'ing, pulling and everything else I could in the VS interface to no avail.

Has anyone else experienced this and can they help me resolve it please.

Thanks

like image 545
onefootswill Avatar asked Jan 31 '14 01:01

onefootswill


People also ask

What is sync in git Visual Studio?

Git in Visual Studio, VSTS, and TFS is standard Git. Although Sync isn't a Git command, some GUI environments provide a sync button to both update your local files and push your local changes to your remote (your hosted repository).

How do I sync a branch in Visual Studio?

For more information on Sync, see Use git fetch, pull, push and sync for version control in Visual Studio. Open the Team Explorer and open the Sync view. Then select the Pull link under Incoming Commits to pull remote changes and merge them into your local branch.

What is sync in git?

git-sync is a simple command that pulls a git repository into a local directory. It is a perfect "sidecar" container in Kubernetes - it can periodically pull files down from a repository so that an application can consume them. git-sync can pull one time, or on a regular interval.


1 Answers

I had the same problem, because a number of package files were removed on the server which were not being used. I had to open command prompt and see all errors by running:

git pull

I saw this error with a list of files to remove:

Please move or remove them before you can merge.
Aborting. 

After removing them I was able to successfully do a pull.

like image 124
katesky8 Avatar answered Sep 17 '22 21:09

katesky8