diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-11-27 11:06:37 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-27 11:06:37 +0900 |
commit | af6e0fe3a589d58bfd508c1c6ccbeb38586eb06b (patch) | |
tree | 62cd50065b0a90efb4339ee10e66aade7f3e94f3 /Documentation | |
parent | Merge branch 'tz/complete-branch-copy' (diff) | |
parent | add: introduce "--renormalize" (diff) | |
download | tgif-af6e0fe3a589d58bfd508c1c6ccbeb38586eb06b.tar.xz |
Merge branch 'tb/add-renormalize'
"git add --renormalize ." is a new and safer way to record the fact
that you are correcting the end-of-line convention and other
"convert_to_git()" glitches in the in-repository data.
* tb/add-renormalize:
add: introduce "--renormalize"
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-add.txt | 9 | ||||
-rw-r--r-- | Documentation/gitattributes.txt | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index b700beaff5..d50fa339dc 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git add' [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]] - [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] + [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize] [--chmod=(+|-)x] [--] [<pathspec>...] DESCRIPTION @@ -175,6 +175,13 @@ for "git add --no-all <pathspec>...", i.e. ignored removed files. warning (e.g., if you are manually performing operations on submodules). +--renormalize:: + Apply the "clean" process freshly to all tracked files to + forcibly add them again to the index. This is useful after + changing `core.autocrlf` configuration or the `text` attribute + in order to correct files added with wrong CRLF/LF line endings. + This option implies `-u`. + --chmod=(+|-)x:: Override the executable bit of the added files. The executable bit is only changed in the index, the files on disk are left diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 4c68bc19d5..30687de81a 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -232,8 +232,7 @@ From a clean working directory: ------------------------------------------------- $ echo "* text=auto" >.gitattributes -$ git read-tree --empty # Clean index, force re-scan of working directory -$ git add . +$ git add --renormalize . $ git status # Show files that will be normalized $ git commit -m "Introduce end-of-line normalization" ------------------------------------------------- @@ -328,6 +327,9 @@ You can declare that a filter turns a content that by itself is unusable into a usable content by setting the filter.<driver>.required configuration variable to `true`. +Note: Whenever the clean filter is changed, the repo should be renormalized: +$ git add --renormalize . + For example, in .gitattributes, you would assign the `filter` attribute for paths. |