Created
October 25, 2017 20:39
-
-
Save cebe/1084422f55cf9a683fe34b440c8cc28d to your computer and use it in GitHub Desktop.
quick remote git repo
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 characters
# prepare server | |
ssh [email protected] | |
git init --bare /srv/testrepo.git | |
exit | |
# in local repo | |
git remote add testrepo [email protected]:/srv/testrepo.git | |
git push testrepo master | |
# now you can add a hook in testrepo.git that runs after push and updates a working copy of /srv/testrepo.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To have the repo automatically checked out and the
master
branch synced on every push:git clone /srv/testrepo.git /srv/testrepo
/srv/testrepo.git/hooks/post-update
:chmod +x /srv/testrepo.git/hooks/post-update