记录一次像github开源项目提交pull request(Hexo Next)

版权声明:本文为作者原创,转载请注明出处,联系qq:32248827 https://blog.csdn.net/dataiyangu/article/details/87630399

背景

前段时间搞自己的博客,在github的next主题上进行了稍微的优化,其中专门针对next主题适配了pjax,有人在我的博客评论,希望我将自己的pjax功能提交pull request(官方pjax路线图出来了,但是貌似没人跟进)。

fork到自己github

在这里插入图片描述
稍后这个项目就会出现在自己的github仓库中。

像往常一样的操作

进入自己的github仓库(项目名是相同的)

克隆到本地

clone or download(最好使用ssh的方式,https的方式不太好)

git clone 刚才复制的连接

然后会多一个跟项目名同名的目录,我这里是hexo-theme-next,进入

与上游建立连接

git remote -v

可以看到此时只与自己的远程仓库建立了连接,发现是只和自己的仓库建立了连接

git remote add upstream   xxxxxx(https://github.com/iissnan/hexo-theme-next.git)

xxxxx是你将要贡献的项目的clone地址
然后再次

git remote -v

结果:

origin	git@github.com:dataiyangu/hexo-theme-next.git (fetch)
origin	git@github.com:dataiyangu/hexo-theme-next.git (push)
upstream	https://github.com/iissnan/hexo-theme-next.git (fetch)
upstream	https://github.com/iissnan/hexo-theme-next.git (push)

创建分支

git checkout -b next-leesin

修改项目代码

此处省略

收尾工作

git add .
git commit -m "add xxx、xxx、xxx"
git push origin next-leesin

如此便推动到了自己仓库的指定分支

提交pull request

进入仓库在code页面有一个
compare & request按钮
compare 处选择刚才提交上来的分支
填写好自己的标题、说明文字(注意最好是英文!!!)
然后点击create pull request
剩下的就是等待通过。

猜你喜欢

转载自blog.csdn.net/dataiyangu/article/details/87630399