git常用操作

343 阅读1分钟

覆盖更新

git fetch --all
git reset --hard origin/master

舍弃追踪某个文件

舍弃追踪 CarDataSpider/utils/DB.py

git update-index --assume-unchanged CarDataSpider/utils/DB.py

继续追踪

git update-index --no-assume-unchanged CarDataSpider/utils/DB.py

记住用户名和密码

git config --global credential.helper store

设置显示提交记录树图别名

git config --global alias.lg "log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"