If remote (using ssh) does not contain the git repository, is it still possible to copy the local repository to remote and setup the remote tracking without manually copying the files using scp and doing then followed by a git clone?
You do need to setup the repository on the remote, but you shouldn't copy the files manually. At the very least, you don't get the history with it.
First, ssh to your remote and do this:
mkdir your_repo.git
cd your_repo.git
git init --bare
The .git
in directory name is completely optional. The --bare
option makes the repository without index and is therefore pushable.
You then go back to your local repository and add the remote:
git remote add remote_name [email protected]:path/to/your_repo.git
You are all set. All you need to do now is:
git push remote_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With