Create a Git Repo through SSH and Cloning it Locally
I have a website on a shared host which support git. Working with FTP is getting too difficult so I am planning to use git in my workflow. I just know basic push, pull, commit commands. I would like to set-up git but not being able to work it out. Here is what I tried till now.
ssh user@host cd ~/mysitedirectory/html git init
and it says git repo initialised. On my local computer, I did this
- Using su/sudo when accessing remote Git repositories over SSH
- GitLab SSH, key not working
- TortoiseGit - Multiple GitHub repositories with different key pairs each
- How to Setup Corkscrew to Connect to Github through Draconian Proxy
- How to associate GIT with SSH protocol (keys)
- Git settings configured for Linux on Windows computer
cd my/local/path git init git remote add origin ssh://user@host:/chroot/somedir/mysiteditectory/html/.git git pull origin master
And it asks for password, which I provide. Then it throws following error.
fatal: Couldn’t find remote ref master
*-iMac:PB_Source *$ fatal: The remote end hung up unexpectedly
I am trying it from last 2-3 hours. Can’t find solution. Please guide me what am I doing wrong.
One Solution collect form web for “Create a Git Repo through SSH and Cloning it Locally”
In a similar situation I found that removing the slash at the beggining of the path, solved the issue. But the syntax was not the same. When using the colon you do not add ssh:// I’d say, so:
git remote add origin user@host:chroot/somedir/mysiteditectory/html/.git
git remote add origin ssh://user@host/chroot/somedir/mysitedirectory/html/.git