Skip to content

github自动同步master分支到gh-pages分支 #2

@GeoLibra

Description

@GeoLibra

master分支仅是浏览代码,而无法将页面直接在网页打开,而gh-pages分支则是用于直接浏览源码页面的分支。每次修改后提交master分支然后切换到gh-pages分支又重新提交一次,显然这个过程非常繁琐。
下面配置自动同步分支
打开github项目文件的根目录,找到.git 这个文件夹(文件夹默认是隐藏的)
然后找到config这个文件
在文件里加入以下两句代码即可:

push = +refs/heads/master:refs/heads/gh-pages
push = +refs/heads/master:refs/heads/master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions