what will happen if I add a file to my git repo and later add a pattern in gitignore that suggests that file is to be ignored
Suppose I have an android project in my repo and I add the apk file. Later I add a gitignore let’s say this one. What will happen in the future to this apk file? The file will keep on changing after each build so will it be checked by git or not? In my case, I want it to continue tracking this file.
- .gitignore not ignoring .idea path
- Removing .xcuserstate and DS_Store files from git
- How can I tell whether the current working directory is ignored by Git?
- Why is /bin/ added to .gitignore in a symfony2 project? Or is it okay for me to push /bin/ to a remote repo?
- How do you manage your ignores?
- is there any way how to tell git to ignore certain lines of a file?
One Solution collect form web for “what will happen if I add a file to my git repo and later add a pattern in gitignore that suggests that file is to be ignored”
The file will continue to be tracked. You can easily find this out just by trying:
$ mkdir /tmp/test $ cd /tmp/test $ git init $ touch foo $ git add foo $ echo "foo" > .gitignore $ git add .gitignore $ git commit -m "initial commit" $ echo foo > foo
git status will show
modified: foo and if you
git add foo, it will be staged despite the