I use TortoiseGit 1.8.3. I changed one of the files: Makefile, but I want to not offer commit it to me every once in a Git Commit. I added it to the "delete and add to ignore list", but it does not help. How do I make to some of the files that I have changed is not offered in the commit?
I want, that Makefile was in remote repository as read-only, that I could edit it locally, and then TortoiseGit does not offer to me to commit it.
That I wanted for Git-bash: https://www.kernel.org/pub/software/scm/git/docs/git-update-index.html
If it doesn't help, then you need to go to a command-line interface, and check:
.gitignore
file that you should find at the root directory of your repo (as mentioned in "TortoiseGit: hide/remove files never to be versioned")git rm --cached Makefile
.git status
.This is different:
You need:
That will make any local modification to
Makefile
"invisible" to git, while keepingMakefile
under source control.If you want your local modifs to resist a
git reset
, do;Answer for TortoiseGit 1.8.15, Git 2.6.1. There is no need to revert to the command line, all functions are directly available in TortoiseGit. I've tried to summarize the various ways how this function is accessible. I assume that the reader knows what "assume unchanged" means. Here is easy documentation about this feature. Or the original documentation about
--assume-unchanged
or git ls-files.Flag a file as "assume unchanged"
There are three possibilities in TortoiseGit: in the
Commit
dialog, theWorking Tree
dialog (Check for Modifications) or in theLog Messages
dialog (only whenWorking dir changes
entry is selected). From one of these dialogs do the following:Assume Unchanged
From any file list in Windows Explorer do the following:
Git
tabAssume valid/unchanged
Remove the "assume unchanged" flag from a file (undo the above):
TortoiseGit allows to remove the flag only from the Working Tree dialog (check for Modifications).
Show ignore local changeds flagged files
assumed valid
orskip worktree
flag will be shown below the normal changed filesUnflag as skip-worktree or assume-unchanged
From any file list in Windows Explorer do the following:
Git
tabAssume valid/unchanged
If I'm interpreting the question correctly, Alex wants to know how to undo an
--assumed-unchanged
action done using Tortoise Git.You don't need to use command line Git to fix this: