Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 6
    If someone else pulls, will the now ignored files be deleted for them or stay untouched? Commented Sep 17, 2012 at 17:19
  • 6
    @Martin Konicek: if the user that's pulling those changes has no modifications to those files, then they will be removed. Commented Sep 29, 2012 at 9:40
  • 33
    @Labanino: -r means recursive, necessary if you're doing whole directories. --cached overrides git's normal behaviour of deleting them from the working directory and staging the deletion for committing, and makes git only operate on the staging area ready for committing. It's how you tell git you want to keep your local copies of the files. Commented Apr 8, 2015 at 18:16
  • 2
    This works nice, but I had to first do: git reset name_of_file for what's described above to work Commented Sep 24, 2017 at 10:53
  • 1
    From my Git v 2.21.0 on Windows 10 x64. git commit -m 'message' have to be git commit -m "message" and git push origin master just use git push. Commented May 24, 2019 at 17:42