如何检查远程(原始)Git存储库上的更改? [英] How to check for changes on remote (origin) Git repository?
问题描述
什么是Git命令来执行以下工作流程?
场景
我从存储库中克隆并执行了自己的一些提交到本地存储库。同时,我的同事向远程存储库提交了提交。现在,我想:
-
检查$ b $上的其他人是否有任何新的
提交b远程仓库,即origin
? -
假设
有3个新的提交远程存储库,因为我上一次
拉,我想用
$远程存储库的提交,即
HEAD〜3
$ c> HEAD〜2 ,HEAD〜2
with
HEAD〜1
和HEAD〜1
与HEAD
。 - <在知道什么是远程更改后,
我想从其他人那里获得最新的
。
到目前为止我的发现
对于步骤2:我知道插入符号 HEAD ^
, HEAD ^^
等以及波浪符号 HEAD〜2
, HEAD〜3
等。
对于第3步:也就是说,我猜,只是一个 git pull
。
您可以 git fetc h origin
来更新存储库中的远程分支以指向最新版本。针对远程设备的差异:
git diff origin / master
是的,您也可以使用脱字符号表示法。
如果您想接受远程更改: / p>
git merge origin / master
Question
What are the Git commands to do the following workflow?
Scenario
I cloned from a repository and did some commits of my own to my local repository. In the meantime, my colleagues made commits to the remote repository. Now, I want to:
Check whether there are any new commits from other people on the remote repository, i.e.
origin
?Say there were 3 new commits on the remote repository since my last pull, I would like to diff the remote repository's commits, i.e.
HEAD~3
withHEAD~2
,HEAD~2
withHEAD~1
andHEAD~1
withHEAD
.After knowing what changed remotely, I want to get the latest commits from the others.
My findings so far
For step 2: I know the caret notation HEAD^
, HEAD^^
etc. and the tilde notation HEAD~2
, HEAD~3
etc.
For step 3: That is, I guess, just a git pull
.
You could git fetch origin
to update the remote branch in your repository to point to the latest version. For a diff against the remote:
git diff origin/master
Yes, you can use caret notation as well.
If you want to accept the remote changes:
git merge origin/master
这篇关于如何检查远程(原始)Git存储库上的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!