git update-index --assume-unchanged and git reset

后端 未结 3 411
旧时难觅i
旧时难觅i 2020-12-04 21:46

Here is the scenario:

In my working directory, I have a number of files (let\'s call them A,B,C) that I\'ve edited. I then ran git update-index --assume-uncha

相关标签:
3条回答
  • 2020-12-04 22:21

    You could use

    $ git stash
    $ git reset --hard
    $ git stash pop
    
    0 讨论(0)
  • 2020-12-04 22:27

    You can do:

    git update-index --skip-worktree A
    
    0 讨论(0)
  • 2020-12-04 22:33

    You need to add a .gitignore file entry for those files if you want to ignore them. Add just the .gitignore file, commit it and you will now ignore any changes to them.

    However, I think you need to tell us why you are doing it, what's the contents of the files, the nature of them (are they artifacts?) - then you'll get the proper answer.

    Also, update-index with the assume-unchanged is meant to be used to increase performance if your tree on your OS's file system takes a long time to gather changes for a particular path. I would not recommend using it in your case unless you are ignoring those files due to lengthy git status or git diff or other command execution times.

    0 讨论(0)
提交回复
热议问题