Git有哪些命令来完成下面的工作流程?
场景
我从一个存储库克隆,并将自己的一些文件提交到本地存储库。与此同时,我的同事对远程存储库进行了提交。现在,我想:
检查是否有新的
提交给其他人
远程存储库,即原点?
上有三个新的提交
远程存储库
拉,我想区别
远程存储库的提交,即。
头~3与头~2,头~2与
HEAD~1和HEAD~1与HEAD。
在知道远程发生了什么变化后,
我想获取最新的提交
从其他人那里。
我目前的发现
对于第二步:我知道插入符号HEAD^, HEAD^^等,以及波浪符号HEAD~2, HEAD~3等。
对于第三步:那就是,我猜,只是一个git拉。
git remote update && git status
在检查Git中是否需要拉的答案上发现了这个
git remote update to bring your remote refs up to date. Then you can
do one of several things, such as:
git status -uno will tell you whether the branch you are tracking is ahead, behind or has diverged. If it says nothing, the local and
remote are the same.
git show-branch *master will show you the commits in all of the branches whose names end in master (eg master and origin/master).
If you use -v with git remote update you can see which branches
got updated, so you don't really need any further commands.