如何拉我倒数第二个

问题描述

运行git log时,我看到:

commit d0fa4410393w92ce6ede2ea26fa2fb74z2e5f1bz (HEAD -> notificationControls,origin/notificationControls)
Author: stufezic-dev <ninjahero@gmail.com>
Date:   Sat Sep 19 12:32:45 2020 +0545

    lockscreen controls working,notification updates yet to fix

commit 2e11d85350a741d6992875e949a0a77abbeb8fde (mainadjust,commitBranch)
Author: stufezic-dev <ninjahero@gmail.com>
Date:   Tue Sep 15 23:30:27 2020 +0545

    notification and lockscreen controls using mediaSession: initiated  
  
commit 2e11d85350a741d6992875e949a0a77abbeb8fde (mainadjust,commitBranch)
Author: stufezic-dev <ninjahero@gmail.com>
Date:   Tue Sep 14 23:30:27 2020 +0545

    notification and lockscreen controls using mediaSession: initiated  
  
...

如何拉倒数第二个或倒数第三个提交,而不是最近的提交?我只知道1条命令:git pull master origin,并且正在考虑如何提取任何提交而不是最新的提交。

解决方法

git pull origin master等效于git fetch origin,后跟git merge origin/master

如果您要合并分支中origin/master以外的其他内容(例如:origin/master之前的第三次提交),请使用git fetch而不是git pull

git fetch

# inspect the history
git log --graph origin/master HEAD

# merge whatever commit you want into your branch
git merge eacf32