Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git & redirections

Tags:

git

I've noticed that when a git (html) project page such as this:

https://github.com/fruux/sabre-dav

is cloned, in this manner:

git clone https://github.com/fruux/sabre-dav .

The actual resulting remote url, as listed with git remote -v is a url such as this:

origin  [email protected]:foo/sabre-dav.git

Presumably because I have push access.

So this made me wonder whether it's possible to redirect any given project url to a git repository. If I for instance own http://myosproject.example.org, is it possible to allow git clone http://myosproject.example.org and have it actually redirect somehow to a github project instead.

like image 587
Evert Avatar asked Oct 17 '13 18:10

Evert


1 Answers

As long as the bare git (the .git folder) is in the web servers DocumentRoot, and you set up a specific post-update hook, it will work.

See this book chapter for more on this

To map your own domain name to a github URL , I think you just need to define an A record (if you know the IP address) or a CNAME record (if you only know the domain name) in your DNS

It may also be possible to configure a reverse proxy in your web server to pass the request for http://my.domain.com/project to http://github.com/project.

like image 132
Tippa Raj Avatar answered Sep 23 '22 23:09

Tippa Raj