Skip to content

Instantly share code, notes, and snippets.

@jmakeig
Last active June 7, 2017 19:47
Show Gist options
  • Save jmakeig/d1dba5e7f99177d10cb11c52155c5d39 to your computer and use it in GitHub Desktop.
Save jmakeig/d1dba5e7f99177d10cb11c52155c5d39 to your computer and use it in GitHub Desktop.
Setting up a remote SSH git server

This assumes you can already ssh USER@HOST with appropriate public key auth.

On the server

  1. Download and compile git source
    curl -O https://www.kernel.org/pub/software/scm/git/git-2.9.4.tar.gz
    tar -gzvf git-2.9.4.tar.gz
    cd git-2.9.4
    make configure
    ./configure --prefix=/home/jmakeig/bin # Install it in my home directory
    make all doc info
    make install
  2. Make sure git is in your path
    echo 'export PATH="$PATH":/home/jmakeig/bin/bin' >> ~/.bashrc
  3. Create and initialize the repo
    mkdir -p ~/git/myrepo.git
    cd ~/git/myrepo.git
    git init --bare

On the client

  1. Add the remote
    git remote add marklogic USER@HOST:/home/jmakeig/git/myrepo.git
  2. Push away
    cd ~/myrepo
    git push marklogic master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment