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).

  • Sometimes git tells me EVERY file is new and unstaged?
  • Why does git remember changes, but not let me stage them?
  • Jenkins build 'cannot find current revision' at GitHub
  • For a shared git repo served over SSH and HTTPS, how to control access for both protocols?
  • Understanding `git reset --hard`
  • How to cancel commits on master and move them to branch
  • WebMatrix 3, cannot push on GitLab
  • git keyword expansion after commit
  • How can I get rid of the 'remote: ' messages that appear on every line returned by post-receive in git?
  • How can I deal with a git repo containing symlinks on windows
  • what is git-remote-http prcess, why there are so many git processes?
  • Git and KDevelop
  • 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.

    Git Baby is a git and github fan, let's start git clone.