Is it possible to ssh to a remote server and trigger a git clone. ie I need to ssh to server A, create a folder /tmp/A and clone a repository with all its contents on A. The ssh keys of the remote servers are configured to connect to git.
ssh root@Server
git init
git clone gitproject.
This doesn't work. Any help is appreciated. I feel the script steps are run asynchronously and thus the clone fails with .git not found.
You said:
"I feel the script steps are run asynchronously"
, this indicates you are doing all this in a script and therefore yourgit init
andgit clone
are done local. You won't actually needgit init
here.Clone the repository remotely on the server
ssh root@server 'git clone gitproject /tmp/A'
to issue the command on the server and have it cloned there.