解决.gitignore忽略⽂件不⽣效问题
-
如果⽂件已经纳⼊了版本管理,那么修改 .gitignore 是不能生效的。需要将 git 的本地缓存删除,然后重新提交。
git rm -r --cache file.txt
-
如果.gitignore文件中没有添加file.txt,则需要在.gitignore中添加该文件的忽略:
file.txt
-
然后提交并push
git commit -m '清除git缓存,解决gitignore忽略file.txt不生效问题"
git push
git log 优化配置
> git config --global alias.lg "log --pretty=oneline --graph --abbrev-commit --date=format:%Y-%m-%d\ %H:%M:%S --decorate --format=format:'%C(auto)%h - %C(dim white)[%ad (%ar)]%C(reset)%C(auto)%d%n'' %C(white normal bold)%s%C(reset) %C(magenta)- %an%C(reset)' --all"