For your config file (or whatever file it is that you want to prevent git from tracking), create it in your repository, and then issue the following command:
git update-index --skip-worktree file_name
The file_name should include the path if it isn't in the current directory (ie: its in a subdirectory).
If the file that you don't want to track is already on git's radar, then you can do the following:
git rm
git rm -r --cached
git commit -m'- Cleaning up and removing file to be ignored'
git push
Then, add the file and edit the conf file with the generic placeholder and do this: git add
git update-index --skip-worktree
git commit -m'- Committing new, untracked file'
git push
One thing to remember, is that when someone clones your repository, before they do anything, they will need to reissue the 'git update-index' command above for the specific file you untracked. That should be noted in your documentation.
No comments:
Post a Comment