Skip to content

Commit af941c0

Browse files
committed
Merge pull request #35 from jpmens/ignore1
Commit all but one file
2 parents 9bf3440 + 31ce22a commit af941c0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
* [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file)
6363
* [Import form a bundle](https://github.com/git-tips/tips#import-form-a-bundle)
6464
* [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch)
65+
* [Ignore one file on commit (e.g. Changelog).](https://github.com/git-tips/tips#ignore-one-file-on-commit-eg-changelog)
6566

6667
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
6768
<!-- @doxie.inject end toc -->
@@ -380,7 +381,7 @@ git archive master --format=zip --output=master.zip
380381
git add --all && git commit --amend --no-edit
381382
```
382383

383-
## Prunes branches that have been deleted in the remote.
384+
## Purnes branches that have been deleted in the remote.
384385
```sh
385386
git fetch -p
386387
```
@@ -437,5 +438,10 @@ git clone repo.bundle <repo-dir> -b <branch-name>
437438
git rev-parse --abbrev-ref HEAD
438439
```
439440

441+
## Ignore one file on commit (e.g. Changelog).
442+
```sh
443+
git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog
444+
```
445+
440446
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
441447
<!-- @doxie.inject end -->

tips.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,9 @@
247247
{
248248
"title": "Get the name of current branch.",
249249
"tip": "git rev-parse --abbrev-ref HEAD"
250+
},
251+
{
252+
"title": "Ignore one file on commit (e.g. Changelog).",
253+
"tip": "git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog"
250254
}
251255
]

0 commit comments

Comments
 (0)