Skip to content

Git

收藏

常见问题

detected dubious ownership in repository at xxx To add an exception for this directory

git config --global --add safe.directory xxx

或者

export GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true

Windows 上 Git 保留可执行文件权限

https://www.cnblogs.com/LoveBB/p/16076897.html

git update-index --chmod=+x a.sh
git ls-tree HEAD

配置默认编辑器

git config --global core.editor vim
# 测试
git commit --amend

从历史版本中彻底删除某个文件或目录

brew install git-filter-repo

git filter-repo --invert-paths --path <文件或目录>