Git pull ignore one file in local directory
It's impossible. git requires an exact copy of the repository to work properly. All git objects (files, directory trees, commits ...) compute the checksum of the object. This is used to create identifiers and further ensure the integrity of the repository. Therefore, ignoring one file will create a completely new repository.
source to share
It's pretty hacky, but theoretically possible with git hooks .
Within the .git
project folder , you can define scripts that will run at different points in the git stream.
On that particular computer, script on pull will remove the file immediately after the pull. Another script will check the file right before pushing so that it doesn't commit the file being deleted.
Finally, you can tell git on this machine to ignore the fact that this file is missing using the git assume-unchanged
function .
source to share