如何在github上提交pr

如何在github上提交pr

1.fork开源的代码到自己的远程仓库

2.clone自己的仓库到本地电脑

3.与源代码的github仓库建立新的连接

git remote add upstream https://github.com/apache/skywalking.git

4.查看是否成功建立连接

  git remote -v

5.创建本地分支

git checkout -b fix_npe

6.修改代码

git add  .
git commit -m "fix_npe"
git push origin fix_npe `将当前分支推送到自己的远程仓库`

7.提交pr

注意事项:
每次PR之前,首先与远程仓库做代码同步(刚才上面的远程仓库链接就是为了做远程代码同步)

git fetch upstream
git rebase upstream/master
git push origin master

push完后,远程仓库便可看到你的branch版本和master分支一致了,否则这个位置会显示与master相差了多少次commit。

猜你喜欢

转载自www.cnblogs.com/assasion/p/11436609.html