0

I'm using Git with Visual Studio 2017 and just recently imported the repositories in from TFSVC. I was able to create a branch from my master, develop against the new branch, and now I'm trying to merge that branch into my master but get the below error.

I will say that part of the problem is that I didn't initially have a .gitignore file setup. Being new with Git I didn't realize I needed one and during the import process of moving the repo from TFSVC into Git it never asked me about creating one. Since the initial setup I've since used Visual Studio to create a .gitignore file for me which should include .vs files but I'm thinking that this error is due to the fact that I synced with my remote Git repo prior to having a .gitignore file in place.

Any suggestions of how I can get things synced up properly? My only other idea is to make a back up copy of my local Git repo so I have my code, then delete the remote and local Git repo, do an import again, add the .gitignore right away, sync with the remote repo, copy all the changed code over to the project, and then commit and sync again. That all seems like jumping through hoops and I'm guessing there is an easier way to handle this but I'm not sure what that is.

Here is the error I'm getting:

enter image description here

Caverman
  • 3,371
  • 9
  • 59
  • 115
  • 2
    Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – alfunx Jun 03 '19 at 20:23

1 Answers1

0

Please commit your changes or stash them before you merge.

The error arises because you (or VS) have made some changes to the storage.ide-{shm,wal} files, which are being tracked by Git, but you have not yet committed the modifications. The error message proposes two ways to address this:

  1. git add -u and git commit, then you'll be able to pull and keep on coding.
  2. git stash, then pull, then git stash pop to restore your modified files.

If these files have been inadvertently tracked, you'll have to carefully git rm them to avoid repeating this collision in the future. I would first copy the files (possibly all of sqlite3) elsewhere, then git rm <file>, then copy things back.

Trevor Keller
  • 510
  • 2
  • 10