mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 23:28:02 +00:00
Add Ignore Changes To A Tracked File as a git til.
This commit is contained in:
@@ -32,6 +32,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
|||||||
- [Clean Out All Local Branches](git/clean-out-all-local-branches.md)
|
- [Clean Out All Local Branches](git/clean-out-all-local-branches.md)
|
||||||
- [Delete All Untracked Files](git/delete-all-untracked-files.md)
|
- [Delete All Untracked Files](git/delete-all-untracked-files.md)
|
||||||
- [Dry Runs in Git](git/dry-runs-in-git.md)
|
- [Dry Runs in Git](git/dry-runs-in-git.md)
|
||||||
|
- [Ignore Changes To A Tracked File](git/ignore-changes-to-a-tracked-file.md)
|
||||||
- [Intent To Add](git/intent-to-add.md)
|
- [Intent To Add](git/intent-to-add.md)
|
||||||
- [Last Commit A File Appeared In](git/last-commit-a-file-appeared-in.md)
|
- [Last Commit A File Appeared In](git/last-commit-a-file-appeared-in.md)
|
||||||
- [List Filenames Without The Diffs](git/list-filenames-without-the-diffs.md)
|
- [List Filenames Without The Diffs](git/list-filenames-without-the-diffs.md)
|
||||||
|
|||||||
14
git/ignore-changes-to-a-tracked-file.md
Normal file
14
git/ignore-changes-to-a-tracked-file.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Ignore Changes To A Tracked File
|
||||||
|
|
||||||
|
Files that should never be tracked are listed in your `.gitignore` file. But
|
||||||
|
what about if you want to ignore some local changes to a tracked file?
|
||||||
|
|
||||||
|
You can tell git to assume the file is unchanged
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git update-index --assume-unchanged <some-file>
|
||||||
|
```
|
||||||
|
|
||||||
|
Reversing the process can be done with the `--no-assume-unchanged` flag.
|
||||||
|
|
||||||
|
[source](http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files/)
|
||||||
Reference in New Issue
Block a user