Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to redirect a git-server address?

(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.

like image 934
Peter Krauss Avatar asked Mar 25 '17 13:03

Peter Krauss


People also ask

How do I change my Git repository address?

You can change a Git remote URL using the git remote set-url command. Navigate to the repository whose remote URL you want to change and then execute this command. The set-url command accepts two arguments: the remote name and the new repository URL. Have you changed the name of a remote Git repository?

How do I redirect a GitHub page?

The redirect is accomplished with a <meta> tag. By setting the http-equiv attribute to refresh and the content attribute to 0; URL=https://example.com/ we will redirect the user to 'https://example.com/'.


1 Answers

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.

like image 152
Gary Avatar answered Oct 09 '22 10:10

Gary