您的位置:首页 > 编程语言

怎么在GitHub上向开源库中提交代码

2015-05-14 20:24 48 查看

怎么在GitHub上向开源库中提交代码

fork想要提交代码的开源库的代码到自己的GitHub项目中

将自己fork后的代码clone到PC上. // remote origin

git clone https://github.com/xxx

添加开源库代码的GitHub路径到PC代码中的remote中. // remote upstream

git remote add upstream https://github.com/yyy

在本地代码中创建新分支

git checkout -b new-branch origin/master

修改代码

将本地新分支的代码提交到自己的GitHub上. // remote origin

git push origin new-branch

打开GitHub网站,进入到项目页,选择新提交的分支



点击页面左边Compare and Review按钮



在比较页中点击Create pull request



输入一个标题和描述内容



点击Create pull request

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: