File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -747,11 +747,15 @@ Git
747
747
git checkout -- < file>
748
748
749
749
# git 注意不要把二进制大文件,视频文件等放入到版本库,可能会导致 .git 非常大,删了也无济于事
750
- find . -executable -type f >> .gitignore # https://stackoverflow.com/questions/5711120/gitignore-without-binary-files
750
+ find . -executable -type f >> .gitignore # https://stackoverflow.com/questions/5711120/gitignore-without-binary-files
751
751
752
- # 如何恢复一个已经删除的分之, https://stackoverflow.com/questions/3640764/can-i-recover-a-branch-after-its-deletion-in-git
753
- git reflog # 查找对应 commit hash
754
- git checkout -b branch-name hash
752
+ # 如何恢复一个已经删除的分之, https://stackoverflow.com/questions/3640764/can-i-recover-a-branch-after-its-deletion-in-git
753
+ git reflog # 查找对应 commit hash
754
+ git checkout -b branch-name hash
755
+
756
+ # git diff 代码显示 tab 为 4 个空格,比如看 go 代码的时候,git diff 显示 8 个
757
+ # https://stackoverflow.com/questions/10581093/setting-tabwidth-to-4-in-git-show-git-diff
758
+ git config --global core.pager ' less -x1,5'
755
759
756
760
# git 如何使用不同的 committer,除了每个项目和全局可以设置 gitconfig 里的 user 外,可以使用如下方式
757
761
# https://stackoverflow.com/questions/4220416/can-i-specify-multiple-users-for-myself-in-gitconfig
You can’t perform that action at this time.
0 commit comments