4

I am using Visual Studio 2017 and trying to sync push my local changes to remote repository using Git plug-in in VS 2017. I staged my changes and committed them. Now when I try to push the changes I get below error-

Error encountered while pushing to the remote repository: rejected Updates were rejected because the tip of your current branch is behind its remote counterpart. Integrate the remote changes before pushing again.

So I tried to fetch and pull the latest changes from the remote repository first. The fetch succeeded but when I pull the incoming commits it gives below error-

Error: Your local changes to the following files would be overwritten by merge: Error: merging of trees 73d9f5683703dbb7dede45aa858a9dc46a156f07 and e59a44271f3ae2b73e397cdade39d4270e7a773c failed

Ideally a pull should fetch and merge the changes. I tried searching for some resolution and came across this link- VS 2017 - Git failed with a fatal error

This solution did not work for me. Any ideas how can I resolve this?

Souvik Ghosh
  • 4,456
  • 13
  • 56
  • 78

1 Answers1

1

While git stash is not yet (Q4 2017) available for Visual Studio (see this uservoice), you can still stash your currently modified files in command line:

cd /path/to/your/repo
git stash

Then your git pull can proceed. Type git stash pop to get back your current changes.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250