1#!/bin/sh 2# Git remote helper for git-secure-export, see gitremote-helpers(7). 3 4if [ ! -e "$GIT_DIR/git-secure-key" ]; then 5 cat 1>&2 <<-EOF 6 * 7 * The symmetric key, needed for decrypting the repository, does 8 * not exist yet. If you are creating a new repository this key 9 * must be created explicitly using git-secure-init.10 *11 * If you are attempting to clone an existing repository and have12 * access to the utilized symmetric key perform the following steps:13 *14 * 1. Manually initialize the repository using git-init(1).15 * 2. Copy the symmetric key to the .git/ directory.16 * 3. Add the secure:// remote manually and pull/fetch.17 *18EOF19 exit 120fi2122# From gitremote-helpers(7):23# The second argument specifies a URL; it is usually of the form24# <transport>://<address>, but any arbitrary string is possible.25URL="$2"2627get_host() {28 echo "$URL" | sed 's|^..*://\(..*\):.*|\1|'29}3031get_path() {32 echo "$URL" | sed 's|^..*://..*:\(.*\)|\1|'33}3435# git-secure-import only encrypts data as specified in the INPUT36# FORMAT section of git-fast-import(1). Similarly, git-secure-import37# only decrypt data matching this format. All other data is simply38# copied from standard input to standard output.39git-secure-export | \40 ssh "$(get_host)" "git-secure-receive $(get_path)" | \41 git-secure-import