我有一个 GitHub 个人资料,并且我将某人的存储库 fork 到我的账户中。并在本地使用 git clone 命令克隆了这个存储库。
git clone https://github.com/my-github-page/repo-name
现在,一些时间已经过去,原始repo所有者已经更新了他的repo,但是我的repo还没有更新。所以,如果我想用git pull
将他的更改合并到我的repo中,但是我也想将本地的更改推送到我的repo中。
简单来说,如果我执行git remote show origin
,我会得到这个结果:
[root@localhost xxx]# git remote show origin
* remote origin
Fetch URL: https://github.com/my-github-profile/xxx
Push URL: https://github.com/my-github-profile/xxx
HEAD branch: master
Remote branches:
1.0 tracked
master tracked
system_tests tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
现在我想把FETCH的URL更改为仓库原始的src。因为原始版本已经更新,但是我的分支落后了。
git remote set-url --fetch
选项,很遗憾它不存在。 - The Godfather