i'm trying to create a setup to push my local git repo to my web server, to later use post receive script to push changes from my website directly to the live website.
How i started:
- Downloaded Git (https://git-scm.com/download/win)
- Opend Git GUI and generated SSH key (without passphrase)
- Copied that to the ~/.ssh/authorized_keys file on my server from the user "myuser"
- connected with terminal to my server and done the following:
$ cd ~
$ mkdir example.com.git
$ cd ~/example.com.git
$ git init --bare
$ exit
- created local a folder on my desktop
- opened git bash there
- entered the following commands:
$ git config --global user.name "My Name"
$ git config --global user.email my@email.com
$ git init
$ git add .
$ git commit -m "First Commit"
- Then i added the remote
git remote add scoutsofnature ssh://myuser@server.domain.tld/~/example.com.git
- When i tried to git push with:
git push -u scoutsofnature master
it fails with following error:
error: src refspec master does not match any
error: failed to push some refs to 'ssh://server.domain.tld:PORTNUMBER/~/example.com.git'
I'm likely new to git so would be nice if somebody can explain where i failed.
That are my references:
Best regards