使用 github 页面
我为 github 上的存储库创建了 gh-pages 分支。在该分支中,我希望有一个 index.html
文件和一个 master
文件夹作为 master 分支的“符号链接”(?)。我希望能够从 index.html
链接到 master 中的文件。
我做了帮助页面告诉我的事情:
$ cd Repos/ampere
$ git fetch origin
remote: Counting objects: 92, done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 68 (delta 41), reused 0 (delta 0)
Unpacking objects: 100% (68/68), done.
From [email protected]:tekkub/ampere
* [new branch] gh-pages -> origin/gh-pages
$ git checkout -b gh-pages origin/gh-pages
Branch gh-pages set up to track remote branch refs/remotes/origin/gh-pages.
Switched to a new branch "gh-pages"
我现在处于带有单个 index.html
文件的 gh-pages 中。我现在该怎么办?
I created gh-pages
branch for a repo on github. In that branch, I want to have an index.html
file and a master
folder being a "symbolic link" (?) to the master branch. I want to be able to link to files in master from index.html
.
I did what help page told me to:
$ cd Repos/ampere
$ git fetch origin
remote: Counting objects: 92, done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 68 (delta 41), reused 0 (delta 0)
Unpacking objects: 100% (68/68), done.
From [email protected]:tekkub/ampere
* [new branch] gh-pages -> origin/gh-pages
$ git checkout -b gh-pages origin/gh-pages
Branch gh-pages set up to track remote branch refs/remotes/origin/gh-pages.
Switched to a new branch "gh-pages"
I'm now in gh-pages with single index.html
file. What am I supposed to do now?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你有一个index.html页面;所以这就像写一个网站一样。如果您想在页面中添加链接,您可以按照向网页添加任何类型的链接的方式进行操作。
由于您位于不同的分支,并且由于该分支是独立的(即它与主项目不同根),因此它不知道另一个分支,因此您不能仅链接到它,除非您可以在存储库级别添加这些文件。
You have an index.html page; so it's just like writing a web site. If you want to have links in your page you do it the same way as you add any kind of link to a web page.
Since you're in a different branch, and since that branch is independent (i.e. it doesn't come off the same root as the main project) it doesn't know about the other branch so you can't just link to it unless you add those files at the repository level.