Suppose you work in a team. You download the project sources and you need to change some configurations according to your working environment, like the tcp port on which to run the webserver or the path where to store the log files. If you commit those files, after your local set up, this would impact the other members of your team when they update.
You cannot simply add them to .gitignore since those files need to be versioned. But you want just to avoid committing your local configuration to your repository.
So here we have a problem…
As far as I know, GIT is the only scm able to handle the issue. This is done by running the command:
$ git update-index --assume-unchanged path/to/file.txt
Once marking a file as such, git will completely ignore any changes on that file; they will not show up when running git status or git diff, nor will they ever be committed.
To make git track the file again, simply run
$ git update-index --no-assume-unchanged path/to/file.txt
Credits to GitHub Help pages for this awesome trick.
To cancel the effect of the --assume-unchanged run
$ git update-index --really-refresh
which does a real refresh ignoring the --assume-unchanged entries.
|« May||Nov »|
- Android (3)
- Apple (30)
- Books (7)
- Eclipse (14)
- Errors (5)
- Firefox (7)
- Git (3)
- Hardware (18)
- Horror Code (8)
- Internet (21)
- Java (106)
- Life, universe and everything (45)
- Lifehacks (26)
- Linux (53)
- Opinions (26)
- OSX (11)
- OWNER API (3)
- Python (1)
- Software (35)
- Speeches and Conferences (8)
- Unix (5)
- Web (23)
- Windows (19)
Android apple architecture Bash bsd configuration CSS Development Düsseldorf framework free Git Google Hardware hdr How-To howto Java Karmic library Linux lion MacBook maven opensource Open Source Opinion os x OSX owner owner api patterns Pitfalls Practices properties Software TDD Testing tip tonemapped Tricks Ubuntu unix video Web