Gitignore update and updating index
Per the instructions on Github, I’ve added a global gitignore (including the config part) for Visual Studio/ASP.NET development. The remote and local repositories are already in place. How can I:
1) Update the index such that forthcoming updates only considers the new updates based on the global.
2) Remove items that were previously committed to the remote repository. Keeping them locally, however (believe I saw a guide online that would actually remove the local files as well).
One Solution collect form web for “Gitignore update and updating index”
I’m guessing you accidentally committed local project files (such as user preferences), and don’t want to pull other users’ local files to your copy.
1) you can’t select which updates to pull from the remote. The
.gitignore file is meant as a commit filter, not a fetch filter. However, you won’t need this after you correctly execute step 2.
2) add the files you don’t want to be in the remote repository to your
.gitignore, then run
git rm filename, commit and push the change. You may also want to commit your new
.gitignore file, so that all other users get the same behavior.