Skip to content

Instantly share code, notes, and snippets.

@huangblue
Created August 20, 2016 12:48
Show Gist options
  • Save huangblue/3a217d0f14ad17a2687af04b16d359df to your computer and use it in GitHub Desktop.
Save huangblue/3a217d0f14ad17a2687af04b16d359df to your computer and use it in GitHub Desktop.
当原仓库更新后,如何更新自己fork别人的项目
git clone https://github.com/huangblue/codeparkshare 将fork的项目克隆到本地
git remote add codeparkshare https://github.com/Yixiaohan/codeparkshare 添加远程仓库(fork的原仓库)
git commit 提交本地变更
git remote update 更新原仓库
git checkout master 检出本地分支
git pull codeparkshare master 从原仓库的master分支摘取数据。
git push 数据推送到github
上述命令成功执行。演习如何从原仓库更新fork仓库
@huangblue
Copy link
Author

感觉git remote add codeparkshare https://github.com/Yixiaohan/codeparkshare 这个命令,是给网址指的那个项目取个名字,大概取成别的也没有关系。

@wolfan
Copy link

wolfan commented Oct 28, 2016

在github页面上如何操作呐?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment