Resume git server management utils
This commit is contained in:
parent
5faa9e0cb9
commit
aac13f9fc7
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh
|
||||
upstream="$1"
|
||||
name="${upstream%/}"
|
||||
name="${name##*/}"
|
||||
name="${name%.git}"
|
||||
|
||||
repo="${HOME}/git/${name}.git"
|
||||
|
||||
# create as bare repo
|
||||
git init --bare "$repo" || exit $?
|
||||
touch "${repo}/git-daemon-export-ok"
|
||||
|
||||
(
|
||||
cd "$repo"
|
||||
git config remote.origin.url "$upstream"
|
||||
# fetch heads and tags only
|
||||
git config --replace-all remote.origin.fetch "+refs/heads/*:refs/heads/*"
|
||||
git config --add remote.origin.fetch "+refs/tags/*:refs/tags/*"
|
||||
# mark this remote to be fetched via update-git-mirrors
|
||||
git config remote.origin.mirror true
|
||||
git fetch -p origin
|
||||
)
|
||||
|
||||
# suggest possible urls to use as remote
|
||||
echo "$(id -un)@$(hostname -f):git/$name.git"
|
||||
echo "git://$(hostname -f)/$(id -un)/$name.git"
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
# i keep a tiny collection of mirrored repositories on some hosts
|
||||
# this script updates them
|
||||
for repo in $HOME/git/*.git; do
|
||||
test -e "$repo" || continue
|
||||
name="${repo%/}"
|
||||
name="${name##*/}"
|
||||
name="${name%.git}"
|
||||
(
|
||||
cd "$repo"
|
||||
test "$(git config remote.origin.mirror)" = true || return
|
||||
git fetch -p origin || echo "[exited with code $?]"
|
||||
) 2>&1 | sed "s|^|$(printf "%16s: " "${name}")|"
|
||||
done
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
name=${PWD##*/}
|
||||
name=${name%.git}
|
||||
|
||||
if test -e git-daemon-export-ok; then
|
||||
for upstream in $(git config --get-all receive.mirror); do
|
||||
url=$(printf "$upstream" "$name")
|
||||
git push --mirror -f "${url}" &
|
||||
done
|
||||
fi
|
||||
|
||||
git update-server-info &
|
||||
|
||||
wait
|
Loading…
Reference in New Issue