diff --git a/README.md b/README.md index 99d7a0a..513693b 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ * [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file) * [Import form a bundle](https://github.com/git-tips/tips#import-form-a-bundle) * [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch) +* [Ignore one file on commit (e.g. Changelog).](https://github.com/git-tips/tips#ignore-one-file-on-commit-eg-changelog) @@ -380,7 +381,7 @@ git archive master --format=zip --output=master.zip git add --all && git commit --amend --no-edit ``` -## Prunes branches that have been deleted in the remote. +## Purnes branches that have been deleted in the remote. ```sh git fetch -p ``` @@ -437,5 +438,10 @@ git clone repo.bundle -b git rev-parse --abbrev-ref HEAD ``` +## Ignore one file on commit (e.g. Changelog). +```sh +git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog +``` + diff --git a/tips.json b/tips.json index 02ccfdc..6d459d1 100644 --- a/tips.json +++ b/tips.json @@ -247,5 +247,9 @@ { "title": "Get the name of current branch.", "tip": "git rev-parse --abbrev-ref HEAD" + }, + { + "title": "Ignore one file on commit (e.g. Changelog).", + "tip": "git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog" } ]