1

In my project I have a config file that I do not want to stage. How can I make sure it does not get staged even when I do git add . ?

bier hier
  • 20,970
  • 42
  • 97
  • 166

1 Answers1

5

Ignore it :

If it's a file nobody wants in your team

Create a file named .gitignore at the root of your project, add the filename into it, and commit it (the .gitignore file).

If it's a file only you don't want

Edit the file named .git/info/exclude and add the filename into it.


More information is available here : https://help.github.com/articles/ignoring-files/

Community
  • 1
  • 1
blue112
  • 52,634
  • 3
  • 45
  • 54
  • I should add : do not want to remove it from source control, just want to use a local version of a file. – bier hier Oct 19 '18 at 04:56