git fetch upstream不起作用

sup*_*toz 8 git

我正试图git fetch upstream master从另一个用户的存储库获取最新的提交.但不幸的是,这不起作用.我也试过了git fetch upstream.

工作是什么git pull upstream master,但我不想一直使用它,因为它将始终自动执行合并.

这是我执行时得到的输出git fetch upstream master:

git fetch upstream master
From https://github.com/jchun/nodeSite
 * branch            master     -> FETCH_HEAD
Run Code Online (Sandbox Code Playgroud)

这是我的遥控器:

git remote -v
origin git@github.com:superzaky/nodeSite.git (fetch)
origin git@github.com:superzaky/nodeSite.git (push)
upstream       https://github.com/jchun/nodeSite.git (fetch)
upstream       https://github.com/jchun/nodeSite.git (push)
Run Code Online (Sandbox Code Playgroud)

Von*_*onC 14

fetch确实有效,但要查看结果,您应该执行以下操作:

git log --oneline --all --graph --decorate --branches
Run Code Online (Sandbox Code Playgroud)

您会看到上游分支(包括上游/主站)

你也可以查看最新的SHA1:

git branch -avv
Run Code Online (Sandbox Code Playgroud)

git pull upstream master没有重复获取部分(因为它已经完成),但合并以及upstream/mastermaster.

  • 嗯,是的,您的第一个命令起作用了,不幸的是第二个命令没有起作用。这是它的屏幕快照链接的链接:http://i.imgur.com/EejCCF5.png我仍然有一个问题:提取确实起作用,但是现在如何使用用户存储库中的最新提交更新存储库? (2认同)