blob: d368ca260eb360c95ee563cb8fdf0b6ddf7198aa (
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
34
35
36
37
38
39
40
|
#!/bin/sh
#
# Mas repo creator!
#
# This script was used to migrate lots of scripts to specific repositories.
# New repositories
REPOS="bash-prompt downloaders git-subtree playlister sedscripts ssl-wrapper start-streaming termplex timelog unisyncer utils-battery utils-calendar utils-cdrecord utils-chroot utils-git utils-gpg utils-image utils-mail utils-spreadsheet utils-ssh utils-tor utils-x11 vbox"
# First stage
for repo in $REPOS; do
cd ~/apps/$repo
touch {README,TODO}.md
git init
git add .
git config user.name "USER"
git config user.email "MAIL"
git remote add DEST1 gitolite@DEST1:$repo.git
git remote add DEST2 gitolite@DEST2:$repo.git
git commit -m "Initial import"
git push DEST1 master
git push DEST2 master
# Remote all
echo '[remote "all"]' >> .git/config
echo ' url = gitolite@DEST1:$repo.git' >> .git/config
echo ' url = gitolite@DEST2:$repo.git' >> .git/config
cd ~/apps
mkdir -p tmp
mv $repo tmp/
git submodule add git://git.sarava.org/$repo $repo
rm -rf $repo
mv tmp/$repo .
rm -rf .git/modules/$repo
done
# Teardown
rmdir tmp
|