0

I am having a bit of difficulty picking up git. While tracking and committing text files is easy, every time I add a Visual Studio project folder to a repository, git throws this (modified content) status at me and I can not get it to add the new content to the repository. I can add the files just great the first time, but any time I edit one of these files, I am unable to add the new files to the next commit.

What can I do to add new files, and why is this not working? I attempted to add some gitignore files to see if possibly I should be ignoring some of the extra Visual Studio files, although I'm not sure I have them added correctly and I was having this issue before and after.

While I have found numerous different people asking about this, none of the answers have fixed my issue.

Thanks in advance, I've been pulling my hair out over this, it just seems so simple.

Visual of the problem:

Visual of the problem

eckes
  • 64,417
  • 29
  • 168
  • 201
Perplexing Pies
  • 123
  • 1
  • 1
  • 9
  • `VetrinaryOffice` is a submodule (https://git-scm.com/docs/git-submodule). `cd VetrinaryOffice` followed by a `git status` will tell you what's going on there. – eckes Apr 18 '16 at 09:50
  • I've been wondering about that. Do submodules get tracked in a different way? As far as I can tell from some reading, it seems like git should be able to keep track of everything in the submodule as well. – Perplexing Pies Apr 18 '16 at 15:52

1 Answers1

0

Just adding the file to .gitignore will not stop the file from being tracked by Git because the file VetrinaryOffice is already in the index.

Follow this link to remove the particular file from the index and commit it. The exact set of commands that you will need is typed below:

git rm --cached VetrinaryOffice git add . git commit -m "Removed Vetrinary Office from index"

The File will not be tracked any more. i.e., You will no longer receive status alerts about modifications to this file within this Git repository.

Community
  • 1
  • 1
Naveen Dennis
  • 1,223
  • 3
  • 24
  • 39
  • Hey! I tried what you suggested and something happened, but it doesn't seem to want to commit. Here's an image: http://imgur.com/GGVmlif – Perplexing Pies Apr 18 '16 at 15:50