Martin Krzywinski
Martin Krzywinski

Reputation: 111

Can I have GitHub automatically redirect from GitHub repo view to GitHub Pages?

In a recent publication, I included a link to the GitHub repository for the code.

https://github.com/martinkrz/posepi1

This link is now in the literature, so I cannot easily change it. I'm wondering whether there's some way to have requests to the repo page (I can't find anything on this) be automatically forwarded to the GitHub Page for the project, which is at

https://martinkrz.github.io/posepi1/

Again, I need a redirect by GitHub.com because I'm practically stuck with the https://github.com/martinkrz/posepi1 link in the published literature.

Upvotes: 1

Views: 211

Answers (2)

MarvinJWendt
MarvinJWendt

Reputation: 2684

This is not possible. You cannot (and to be honest nobody should) change or create self-executing code on your GitHub repository.

And thus, you cannot redirect users.

But you can put the GitHub Pages link into the description of the repository and/or add it as a link in the README.md The link could be

Click here to see the code in action!

or something like that

Upvotes: 1

bk2204
bk2204

Reputation: 76439

No, this isn't possible. If it were, it wouldn't be possible for anyone to view the repository's overview page anymore, which would make doing common tasks difficult.

You could try updating your repository README to point to the place you'd like people to go, but that's the extent of the changes you can make.

Upvotes: 1

Related Questions