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 .
?
Asked
Active
Viewed 104 times
1

bier hier
- 20,970
- 42
- 97
- 166
-
How about adding it to `.gitignore`? – bereal Oct 18 '18 at 09:20
-
I don't want todo that because it is just a local version. – bier hier Oct 18 '18 at 09:21
-
Possible duplicate of [How do I configure git to ignore some files locally?](https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally) – phd Oct 18 '18 at 13:12
1 Answers
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/
-
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