Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pull a git repository from remote server?

Tags:

git

I've seen a few similar questions asked, but they didn't help me figure this out, and I couldn't find any tutorials (I wasn't really sure what I am looking for, to be honest). Also, I haven't used git apart from pulling/pushing onto GitHub, which is why (at least I believe so) I am so confused! GitHub made me spoiled about setting a repo up!

What I did on the server:

  • sudo apt-get install git Which installed (I think) everything I needed to proceed.
  • I created a test repository (just a few txt and html files) inside git_test
  • git init
  • git add .
  • git commit
  • I also used vim .git/description to change the description to starships.

What I did from my computer

I have git pre-installed

  • git clone destielstarship@[remote_server]/starships1

Which produced this error: fatal: Unable to look up destielstarship@[remote_server](port 9418) (A non-recoverable error occurred during a database look-up. )


  1. I replaced the IP address with [remote_server] for clarity, I hope I didn't make it more confusing.


Update: Whoops! Fixed an awkward typo!
like image 939
omninonsense Avatar asked Aug 19 '13 21:08

omninonsense


1 Answers

TL;DR

Unless you're running git-daemon on the remote server, you probably want to use ssh rather than git for your URI scheme.

SSH Schemes

To use SSH as your transport, you can clone your repository using the a different URI scheme. For example, assuming your username on the remote host is "destielstarship," you could use the following command:

git clone ssh://[email protected]/path/to/git_test

You can leave off the .git extension for the repository in most cases, and only need to specify a username for the remote host if it differs from your current login.

like image 153
Todd A. Jacobs Avatar answered Oct 19 '22 23:10

Todd A. Jacobs