How to find out or change url for Git Repository server

15,431

Solution 1

(1) As for the domain names - as long as they all resolve to the server IP, it shouldn't matter. Git ultimately connects over SSH, in this case to your gitosis server. If you can connect via SSH to your machine via any of those parked domains, you can use it as your git url.

I don't believe that git allows you to list multiple urls per remote, so if you want to have all three listed (worst case scenario perhaps) just setup three remotes, each with a different domain to your server.

(2) That's really simple. Check out your .git/config file inside your project directory.

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = [email protected]:my_awesome_app
    fetch = +refs/heads/*:refs/remotes/origin/*

You need to update the url; for example, I'm using github :) You can also add other remotes manually. Tracking upstream branches will append their info to this file as well, for example

[branch "master"]
    remote = origin
    merge = refs/heads/master

which follows the above listing is how git manages tracking of remote branches. Hope this helps.

Cheers, Mike.

Solution 2

Any of those domains should work as long as they resolve to the same IP.

Share:
15,431
Timus83
Author by

Timus83

Updated on June 12, 2022

Comments

  • Timus83
    Timus83 almost 2 years

    I've installed Git and Gitosis on Ubuntu server which has 3 domain names parked. How do I know, which of these domain names are used by Git to construct Git access url, like for example, this: git@xxxxxxxx/repository.git Where can I set up this xxxxxxx value? Thank you in advance, Git looks to be great.

  • cyrilchampier
    cyrilchampier almost 12 years
    I edited the url, now i have: Permission denied (publickey). Ssh is working, but not git !
  • Michael De Silva
    Michael De Silva almost 12 years
    That happens where there's an issue on the git server side in terms of public-key configs...
  • cyrilchampier
    cyrilchampier almost 12 years
    I found my problem: i forgot to specify the port... But the message should have been "impossible to connect" !?