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


我的博客: https://mmmmmm.me
源码: https://github.com/dataiyangu/dataiyangu.github.io

背景

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

fork到本身github

在这里插入图片描述
稍后这个项目就会出如今本身的github仓库中。github

像往常同样的操做

进入本身的github仓库(项目名是相同的)web

克隆到本地

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

git clone 刚才复制的链接

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

与上游创建链接

git remote -v

能够看到此时只与本身的远程仓库创建了链接,发现是只和本身的仓库创建了链接svg

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

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

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

修改项目代码

此处省略spa

收尾工做

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

如此便推进到了本身仓库的指定分支code

提交pull request

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

相关文章
相关标签/搜索