No you are not doing anything wrong.
The ideal way to run a sequence of steps after a particular type of action would be to use a git-hook
for that action. However, that won't be possible here - there is no git-clone hook
in git
which could do that for you -- i.e.,automatically add a remote whenever a new clone is made for you.
Check out answers on git-clone and post-checkout hook and is there a clone hook.
Basically, If you were cloning the same repo on the same machine again and again, then you could have used --template
flag for the hook; However, since you are checking out the repo on different machines everytime, you will need to copy the template hook on each new machine, which is bad.
It is better that you run the command git remote add live ssh://user@myserver:port/directory
everytime you clone the repository, from within the cloned repository.
You can then run git remote -v
to check all the remotes available in the repository.