I have stored the git on bitbucket and working from few places (work/home desktop/laptop/2 servers). I always pushing to remote and doing pull from other machines. The issue - on one machine only, there's a file i don't want it to be pulled/downloaded from git every time. What can be done?
-
What kind of file is it? – Tim May 06 '15 at 21:01
-
text file that contain the configuration for local machine where runs this code. – user2988257 May 08 '15 at 09:30
2 Answers
It is not possible. git requires exact copy of the repository in order to work properly. All git objects (files, directory trees, commits...) calculate checksum of the object. This is used to create identifiers and additionaly enforces integrity of the repository. Therefore ignoring one file would create completely new repository.

- 46
- 2
It's pretty hacky, but it should be theoretically possible by using git hooks.
In the .git
folder for a project, it's possible to define scripts to be run at different points in the git flow.
On this one particular machine, the script on pull would delete the file right after pulling. Another script would check out the file right before pushing so it doesn't commit the deletion of the file.
Lastly, you might want to tell git on this machine to ignore the fact that this file is missing using git's assume-unchanged
feature.