[PATCH v2] docs: clarify git rm --cached function in gitignore note
- From
- Sohom Datta via GitGitGadget <gitgitgadget@gmail.com>
- Date
- May 3, 2023, 15:31 UTC
- Message-ID
- <pull.862.v2.git.git.1683127916363.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.862.git.git.1601888338644.gitgitgadget@gmail.com>
From: Sohom <sohom.datta@learner.manipal.edu>
Explain to users that the step to untrack a file will not also keep it untracked in the future.
Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>
---
docs: Clarify git rm --cached function in gitignore note
Added text explaining that the git rm --cached command isn't analogous
to the gitignore file and that the file will need to be added to
gitignore to prevent later commits from adding the file back.Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-862%2Fsohomdatta1%2Fgitignore-note-v2 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-862/sohomdatta1/gitignore-note-v2 Pull-Request: https://github.com/git/git/pull/862
Range-diff vs v1:
1: 053e9f99c9e ! 1: c3257398c8f docs: clarify git rm --cached function in gitignore note
@@ Metadata
## Commit message ##
docs: clarify git rm --cached function in gitignore note
- Added text explaining that the git rm --cached command
- isn't analogous to the gitignore file and that the file
- will need to be added to gitignore to prevent later
- commits from adding the file back.
+ Explain to users that the step to untrack a file will not also keep it
+ untracked in the future.
Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>
@@ Documentation/gitignore.txt: The purpose of gitignore files is to ensure that ce
+can then be added to the `gitignore` file to stop the file from
+being reintroduced in later commits.
- EXAMPLES
- --------
+ Git does not follow symbolic links when accessing a `.gitignore` file in
+ the working tree. This keeps behavior consistent when the file isDocumentation/gitignore.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt index f2738b10db6..8b78e1b3e08 100644 --- a/Documentation/gitignore.txt +++ b/Documentation/gitignore.txt @@ -146,7 +146,9 @@ The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked. To stop tracking a file that is currently tracked, use -'git rm --cached'. +'git rm --cached' to remove the file from the index. The filename +can then be added to the `gitignore` file to stop the file from +being reintroduced in later commits. Git does not follow symbolic links when accessing a `.gitignore` file in the working tree. This keeps behavior consistent when the file is base-commit: 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8
-- gitgitgadget