How to find out or change url for Git Repository server
Asked Answered
T

2

6

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.

Turdine answered 11/5, 2011 at 10:45 Comment(0)
B
13

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

Bastion answered 11/5, 2011 at 10:50 Comment(3)
I edited the url, now i have: Permission denied (publickey). Ssh is working, but not git !Latinism
That happens where there's an issue on the git server side in terms of public-key configs...Bastion
I found my problem: i forgot to specify the port... But the message should have been "impossible to connect" !?Latinism
E
1

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

Ebert answered 11/5, 2011 at 19:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.