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

后端 未结 4 872
野性不改
野性不改 2021-01-31 03:35

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 l

4条回答
  •  梦毁少年i
    2021-01-31 03:56

    If it doesn't help, then you need to go to a command-line interface, and check:

    • the content of the .gitignore file that you should find at the root directory of your repo (as mentioned in "TortoiseGit: hide/remove files never to be versioned")
    • the result of git rm --cached Makefile.
    • the result of git status.

    I want, that Makefile was in remote repository in read-only, that I could edit it localy, and then TortoiseGIT does not offer to me to commit it.

    This is different:

    You need:

    git update-index  --really-refresh --no-assume-unchanged Makefile
    

    That will make any local modification to Makefile "invisible" to git, while keeping Makefile under source control.

    If you want your local modifs to resist a git reset, do;

    git update-index --skip-worktree Makefile
    

提交回复
热议问题