Tuesday, April 4, 2017

how to redirect a git-server address?

Leave a Comment

(suppose) I have my own git, so you can do

  git clone https://official.example.org/myproject.git 

But, at my server official.example.org I want to redirect it to Github. How to do it at UBUNTU 16LTS standard git-server? It is an usual web-server redirect (eg. Apache) or need special preparation?

PS: the technology exist, as announced here.

2 Answers

Answers 1

As far as I know, it's not possible. On Github, the old repository will be redirected to the new one in the same domain and it's the main point here.

Trying to redirect official.example.org to github.com will broke the certificate's chain, making it impossible to handle.

Answers 2

I use the git post-receive hook in my buildfarm to automatically build projects in Jenkins when code is pushed to my git repository. You could do something similar with some of the other git hooks on your server to push code to github.

Similarly, on github you could define a webhook to update your git repository on official.example.org whenever code in the github repository is updated. Something like this answer maybe.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment