Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make to some of the files that I have changed is not offered in the commit?

Tags:

tortoisegit

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

like image 832
Alex Avatar asked May 27 '13 20:05

Alex


People also ask

How do you display a list of files added or modified in a specific commit?

OK, there are a couple of ways to show all files in a particular commit... To reduce the information and show only names of the files which committed, you simply can add --name-only or --name-status flag... These flags just show you the file names which are different from previous commits as you want...

How do you add files to existing commit in git?

To add and commit files to a Git repository Create your new files or edit existing files in your local project directory. Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed.

How do you check changes before commit?

If you just want to see the diff without committing, use git diff to see unstaged changes, git diff --cached to see changes staged for commit, or git diff HEAD to see both staged and unstaged changes in your working tree.


2 Answers

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, the Working Tree dialog (Check for Modifications) or in the Log Messages dialog (only when Working dir changes entry is selected). From one of these dialogs do the following:

  • right-click the file and select the entry Assume Unchanged


From any file list in Windows Explorer do the following:

  • right-click the file and select properties
  • go to the Git tab
  • tick the entry Assume 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).

  • in the lower left corner of the dialog: make sure to tick the option Show ignore local changeds flagged files
  • all files with assumed valid or skip worktree flag will be shown below the normal changed files
  • right-click on the file and select Unflag as skip-worktree or assume-unchanged


From any file list in Windows Explorer do the following:

  • right-click the file and select properties
  • go to the Git tab
  • untick the entry Assume valid/unchanged
like image 151
user23573 Avatar answered Sep 21 '22 12:09

user23573


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:

  1. Navigate to the file(s) you did this action on in windows explorer,
  2. Right-click and choose Properties,
  3. Select the Git tab, there you should see a checked box next to "Assume valid/unchanged".
  4. Uncheck it and it won't be ignored by commits moving forward.

enter image description here

like image 26
deaddancer Avatar answered Sep 20 '22 12:09

deaddancer