1). 在 Fork 的代码库中添加上游代码库的 remote 源 (# upstream 表示上游代码库名称)
git remote add upstream git://gitcafe.com/yan5845hao/ShortUrl.git
2). 本地修改和提交 (commit)
git commit -m '提交更新'
3). 在每次 Pull Request 前做如下操作,即可实现和上游版本库的同步。
git remote update upstream
git rebase upstream/master
# 如果不是 master 分支,请把 master 改为相应的分支名,
同时在 rebase 前用 git checkout 命令切换到相应的本地分支
4). 如果有代码冲突要解决代码冲突,然后将代码加入到git缓冲区,没有直接Push
git add source.js
git rebase --continue
5). Push 代码到 GitCafe
git push