summary refs log tree commit diff stats
path: root/git-init-remote
diff options
context:
space:
mode:
Diffstat (limited to 'git-init-remote')
-rwxr-xr-xgit-init-remote33
1 files changed, 33 insertions, 0 deletions
diff --git a/git-init-remote b/git-init-remote new file mode 100755 index 0000000..4d8cb29 --- /dev/null +++ b/git-init-remote
@@ -0,0 +1,33 @@
1#!/bin/sh
2
3GITREMOTE=git.acdw.net
4GITROOT=/git
5
6git ls-files > /dev/null || exit 1
7
8# consider --git-dir as well .. however --git-dir would require more massaging
9# of the output.
10local="$(git rev-parse --show-toplevel)"
11name="${local##*/}"
12
13remote="$GITROOT/$name.git"
14
15## Remote work
16
17# Initiate the repository
18echo "ssh \"$GITREMOTE\" git init --bare \"$remote\""
19ssh "$GITREMOTE" git init --bare "$remote"
20
21# Add a description
22echo -n "Repo description: "; read
23echo "ssh \"$GITREMOTE\" sh -c \"echo '$REPLY' > '$remote'\""
24ssh "$GITREMOTE" sh -c "echo '$REPLY' > '$remote'"
25
26# Add post-update-hook
27echo "scp post-update.hook \"$GITREMOTE:$remote/hooks/post-update\""
28scp post-update.hook "$GITREMOTE:$remote/hooks/post-update"
29
30## Local work
31
32echo "git remote add origin \"$GITREMOTE:$remote\""
33git remote add origin "$GITREMOTE:$remote"