Lets say I have a file named "personal notes". It is tracked on my initial push to my repo. Then I want anyone who pulls the repo to get the "personal notes" file. Then the users modify "personal notes" locally. How do I make it so that git will provide the initial file, but then no longer track changes to that file?
Asked
Active
Viewed 33 times
1
-
2Does this answer your question? [Keep file in a Git repo, but don't track changes](https://stackoverflow.com/questions/9794931/keep-file-in-a-git-repo-but-dont-track-changes) – Papooch Apr 02 '20 at 18:03
-
I really just want the file to be included when people pull but then never tracked by anyone afterwards. – cgfghf hkjhkj Apr 02 '20 at 19:03
-
I don't think that is possible without the user's intervention.You can create a startup script, that creates the file for you (which will be in .gitignore), but the user still has to run it. – Papooch Apr 02 '20 at 19:56
-
4Don't do this. Store a *template* file in the repository. Have your software copy the template to the actual file (which is then ignored), or just give everyone instructions to do that, after which they modify the notes all they like but it's still not in the repository. Trying to do this, with the `update-index` trick, just makes everyone miserable. Don't do it, and everyone is happy. – torek Apr 02 '20 at 19:56
-
It was asked 2 hours ago: [Keep existing files from getting updates in Git](https://stackoverflow.com/questions/60995052/keep-existing-files-from-getting-updates-in-git/60995920#60995920) – krisz Apr 02 '20 at 20:43