使用 github 页面

发布于 2024-12-29 09:15:33 字数 860 浏览 0 评论 0原文

我为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

感情旳空白 2025-01-05 09:15:33

你有一个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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文