-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·62 lines (47 loc) · 934 Bytes
/
setup.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
#subtree installation
# dir for generation of the example
testdir=~/temp/subtreetest
#install git subtree if not already present
if ! [ -f /usr/lib/git-core/git-subtree ]
then
cd /tmp
git clone git://github.com/apenwarr/git-subtree.git
cd git-subtree
sudo bash install.sh
fi
#exampleprojekt
# clean up if previous versions exist
rm -rf ~/temp/subtreetest
#setup repositories
mkdir -p $testdir
cd $testdir
mkdir .repo
cd .repo
mkdir example
cd example
git init --bare
cd ..
mkdir subexample
cd subexample
git init --bare
# checkout and do some commits
cd $testdir
git clone .repo/example
cd example
touch foo bar baz
git init
git add .
git commit -m "init"
git push origin master
cd $testdir
git clone .repo/subexample
cd subexample
touch subfoo subbar subbaz
git init
git add .
git commit -m "init sub"
echo "something" >> subfoo
git add .
git commit -m "something in subfoo"
git push origin master