I’m trying to write a .gitignore file. I’d like to get a preview of everything that would be added if I were to run “git add -u”. Is that possible? Or, if I ran “git add -u”, and some stuff got added that I don’t want, can I undo the entire thing? Then I’ll tweak my .gitignore some more and repeat.
Thanks
I think you’re looking for:
git add -n.. which is the
--dry-runshort switch 🙂Edit: from the root of the repository, try:
git add -n .If you were to mistakenly add files that were supposed to be ignored, and you didn’t catch it in the dry run, you’d just use:
git reset HEAD --.. which would essentially unstage the files.