github 的 pr 使用方法(pull request)
2018-09-17 本文已影响0人
斯嘎啦
以open-falcon
为例:
- fork在GitHub上的Repository到自己的GitHub
- clone自己的GitHub Repository到本地电脑
- 与远程GitHub上的的Repository建立新的链接
git remote add upstream https://github.com/open-falcon/falcon-plus.git
-
git remote -v
查看是否建立了链接 - 创建分支
git checkout -b falcon-fs
- 修改代码
git add sys.go
git commit -m "modify sys.go"
git push origin falcon-fs `将当前分支推送到自己的远程仓库`
- 提交PR
Create pull request
注意事项:
- 每次PR之前,首先与远程仓库做代码同步(刚才上面的远程仓库链接就是为了做远程代码同步)
git fetch upstream
git rebase upstream/master
git push origin master
push完后,远程仓库便可看到你的branch版本和master分支一致了,否则这个位置会显示与master相差了多少次commit。