You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
950 B
43 lines
950 B
2 years ago
|
+++
|
||
|
# vim: ft=markdown
|
||
|
title = 'Stop tracking changes of a file with git'
|
||
|
summary = '''Don't overuse this; it could get a bit more complicated to track
|
||
|
down errors when ignoring changes of files...'''
|
||
|
date = '2023-06-04T18:00:51+02:00'
|
||
1 year ago
|
lastmod = '2023-11-02T18:56:06+0000'
|
||
2 years ago
|
categories = [ 'computerstuff' ]
|
||
1 year ago
|
tags = [ 'git' ]
|
||
2 years ago
|
|
||
|
+++
|
||
|
|
||
|
For very rare situations this git command is very handy. I use this on my
|
||
|
_dotfiles_ repository on a config file that I don't need to update recent
|
||
|
changes (like htoprc).
|
||
|
|
||
|
## Ignore an already tracked file
|
||
|
|
||
|
```console
|
||
|
$ git update-index --assume-unchanged <filename>
|
||
|
```
|
||
|
|
||
|
## Start tracking again
|
||
|
|
||
|
```console
|
||
|
$ git update-index --no-assume-unchanged <filename>
|
||
|
```
|
||
|
|
||
|
Source: <https://stackoverflow.com/a/23673910>
|
||
|
|
||
1 year ago
|
## List untracked files
|
||
|
|
||
|
To list all files with the assumed-unchanged bit set, run this command.
|
||
|
|
||
|
```console
|
||
|
$ git ls-files -v | grep "^h"
|
||
|
h go.mod
|
||
|
h go.sum
|
||
|
```
|
||
|
|
||
|
The lowercase <kbd>h</kbd> indicates that.
|
||
|
|