blob: 5a07bd59547c645c62cad3758c45436594373fbd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/bin/sh
GITREMOTE=git.acdw.net
GITROOT=/git
git ls-files > /dev/null || exit 1
# consider --git-dir as well .. however --git-dir would require more massaging
# of the output.
local="$(git rev-parse --show-toplevel)"
name="${local##*/}"
remote="$GITROOT/$name.git"
## Remote work
# Initiate the repository
echo "ssh \"$GITREMOTE\" git init --bare \"$remote\""
ssh "$GITREMOTE" git init --bare "$remote"
# Add a description
echo -n "Repo description: "; read
echo "ssh \"$GITREMOTE\" sh -c \"echo '$REPLY' > '$remote/description'\""
ssh "$GITREMOTE" sh -c "echo '$REPLY' > '$remote/description'"
# Add post-update-hook
echo "scp post-update.hook \"$GITREMOTE:$remote/hooks/post-update\""
scp post-update.hook "$GITREMOTE:$remote/hooks/post-update"
## Local work
echo "git remote add origin \"$GITREMOTE:$remote\""
git remote add origin "$GITREMOTE:$remote"
|