因為公司code base很肥大(?)一個專案17.xGB
但因為不是always在master branch做事或是想要參考(複製/確認)其他branch的一些東西,會需要去checkout不同的branch
這時候worktree就很好用了
因為公司code base很肥大(?)一個專案17.xGB
但因為不是always在master branch做事或是想要參考(複製/確認)其他branch的一些東西,會需要去checkout不同的branch
這時候worktree就很好用了
I've a file in a Git control project that I've do some local change, and don't want it to be overwrite.
so I use
$ git update-index --skip-worktree <file-list>
to avoid the over write
but strange thing happen today when I'm trying to checkout another branch, Git ask me to commit / stash local change, but when I stash local change
git> No local change to save
but when I checkout
git > please commit your changes or stash them before you switch branches
my Git version is 2.30.2
so I can only
$ git update-index --no-skip-worktree <file-list>
then
$ git stash
$ git checkout
清除未追蹤檔案
git clean -fx
(x表示連同ignored files)
可以先用
git clean -fxn
測試
還原git controlled files
git reset --hard