Created
November 3, 2017 09:02
Revisions
-
Kukunin created this gist
Nov 3, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ # We are in a folder with local git repository pwd # We need to create an empty repo on the server # We want to checkout another branch because # git prevents you from pushing to the current checked branch, which is master by default ssh <user>@<host> 'mkdir repo && cd repo && git init && git checkout -b local' # Add remote repo git remote add server <user>@<host>:repo # Push master or whatever you want git push server master # Updates files tree to match your pushed branch ssh <user>@<host> 'cd repo && git reset --hard master' # That's it. You have a copy of git repository on the server without any intermediate repository