Skip to content

Instantly share code, notes, and snippets.

@cebe
Created October 25, 2017 20:39
Show Gist options
  • Save cebe/1084422f55cf9a683fe34b440c8cc28d to your computer and use it in GitHub Desktop.
Save cebe/1084422f55cf9a683fe34b440c8cc28d to your computer and use it in GitHub Desktop.

Revisions

  1. cebe created this gist Oct 25, 2017.
    13 changes: 13 additions & 0 deletions remote-git.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@

    # 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