Accessing git

I'm having difficulty accessing git on my Linode (Ubuntu). I followed the very good howto in the library, but that has problems, so I tried back-to-basics, but that has problems too, as follows:

On the Linode I do:

(su) apt-get install git-core

mkdir myrepo.git

git init –bare

On my local machine, I do:

cd

git init

git add git commit -m "first commit"

git remote add origin ssh://myuser@mylinode.com/myrepo.git

git push origin master

I get the message:

fatal: 'myuser@mylinode.com/myrepo.git' does not appear to be a git repository

All the howtos I've read on the web say this should work, but it doesn't. Can anyone give me any clues as to why?

2 Replies

You don't want to init the repo locally, you probably want to clone it. Second, unless your repo is stored in /myrepo.git on your linode, you probably want to specify the full path.

Server:

$ cd ~

$ mkdir myrepo.git

$ cd myrepo.git

$ git init –bare

Client:

$ git clone ssh://user@host/home/USERNAME/myrepo.git

$ git add file.c

$ git commit -m "commitlog"

$ git push

Hey - thanks for this. That got it working. I've also applied it to the Linode howto, and that's working now too. All I have to do now is learn git :-)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct