How can I swap the IP with a DNS link for git remote?

47 Views Asked by At

I'm struggling to understand how to properly run a git server.

I've been following this https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server

What I'm trying to do is run the server on computer A and be able to push and fetch from both computer B on the same network and computer C on a different network.

I have forwarded port 22 to computer A and have duckdns setup. I also have computer B's SSH public key copied into authorized_keys on computer A.

This is the git command I've tried

git remote add origin [email protected]:/srv/git/project.git

Then when I try to push, it gives the following

ssh: connect to host gitserver.duckdns.org port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I also tried

git remote add origin http://gitserver.duckdns.org:/srv/git/project.git

and got

fatal: unable to access 'http://gitserver.duckdns.org:/srv/git/project.git/': Failed to connect to gitserver.duckdns.org port 80 after 129444 ms: Couldn't connect to server

Not sure what to try next.

0

There are 0 best solutions below