创建GitHub页面回复 [英] Creating GitHub Pages Repo

查看:232
本文介绍了创建GitHub页面回复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

username.github.com/repo-name



有关设置username.github.com/repo-name *的说明

  cd / path / to / repo-name 
git symbolic-ref HEAD refs / heads / gh-pages
rm .git / index
git clean -fdx
echoMy GitHub Page> index.html
git add。
git commit -a -m第一页提交
git push origin gh-pages

我这样做了: cd / path / to / repo-name

在我完成 git clean -fdx 后,被删除。我必须从github下载它们。



这个( / path / to / repo-name )意思是在一个新目录?

解决方案

您看到的命令旨在创建一个空分支 gh-pages



它不是一个新的目录,而是一个新的分支,没有链接到你的主人和其他分支,并在那里添加github页面相关的内容。它一定是作为第一步完成的,但是添加文件后可能已经完成了,这可能没有问题。阅读gh-pages wiki上的说明。它解释了为什么需要上述命令,并警告您会丢失文件,就像您一样 - http:// pages .github.com /



您也可以使用 git checkout --orphan gh-pages 作为一个替代方案。



请参阅我的答案:如何在Git中没有父级创建提交?


username.github.com/repo-name

Instructions for setting up username.github.com/repo-name *

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
git add .
git commit -a -m "First pages commit"
git push origin gh-pages

I did this : cd /path/to/repo-name
After I did git clean -fdx, all my files got deleted. I had to download them from github.

Was this (cd /path/to/repo-name) meant to be on a new directory ?

解决方案

The commands that you are seeing are meant to create an empty branch gh-pages.

It is not meant to be a new directory, but a new branch, with no link to your master and other branches and add the github pages related content in there. It must have been done as a first step, but you might have done it after adding files, which might be fine. Read the instructions on the gh-pages wiki. It explains why the above commands were needed and also warns that you will lose the files, like you did - http://pages.github.com/

You can also use git checkout --orphan gh-pages as an alternative.

See my answer here: How do I create a commit without a parent in Git?

这篇关于创建GitHub页面回复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆