ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] # git-shortlog 根据每位作者的提交次数而不是作者字母顺序对输出进行排序。 ```shell git shortlog -s -n ``` # git-bisect git 有一个以二分法帮助定位问题的命令 `bisect`。 ```shell # 开始二分查找问题 git bisect start # 标记当前有问题 git bisect bad # 标记哪个 commit 或 tag 时是没问题的 git bisect good v1.0.0 # 此时 git 会 checkout 两个点之间的某个 commit, # 如果此时还是有问题: git bisect bad # 如果此时没有问题: git bisect good # 接着 git 会 checkout 下一个「有问题」和「没问题」之间的 commit # 直到定位到问题,git 会提示:xxxxxxx is first bad commit ``` # 用 Fetch 和 Merge [Git 少用 Pull 多用 Fetch 和 Merge](https://www.oschina.net/translate/git-fetch-and-merge) # git add -A和git add .区别 **一.版本导致的差别:** 1.x版本: (1).`git add all` 可以提交未跟踪、修改和删除文件。 (2).`git add .` 可以提交未跟踪和修改文件,但是不处理删除文件。 2.x版本: 两者功能在提交类型方面是相同的。 **二.所在目录不同导致的差异:** (1).`git add all` 无论在哪个目录执行都会提交相应文件。 (2).`git add .` 只能够提交当前目录或者它后代目录下相应文件。 (3).`git add -u`  提交被修改(modified)和被删除(deleted)文件,不包括新文件(new) # `git push -u` "Upstream" would refer to the main repo that other people will be pulling from, e.g. your GitHub repo. The `-u` option automatically sets that **upstream** for you, linking your repo to a central one. That way, in the future, Git "knows" where you want to push to and where you want to pull from, so you can use `git pull` or `git push` without arguments. A little bit down, [this article](http://mislav.uniqpath.com/2010/07/git-tips/) explains and demonstrates this concept. # `git pull` & `git fetch`