summaryrefslogtreecommitdiff
path: root/demo-script
blob: 99e952c604be2c03b34f26293c48e8cd562e100e (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
. /t/prompt/prompt 
test -d demo && rm -rf demo/
test -d ../demo && cd .. && rm -rf demo/ 
clear
################################################################
#  prompt part related to git is inside ().  "M" stands for master.
#  Intersting files are shown and colored according to git state.
#  Red - modified,  green - added to index, blue - untracked, 
#  magenta - operation in progress (merge, rebase, ...)
#################################################################
mkdir demo; cd demo
git init
echo "1st line" > file
git add file
touch  untracked-file
rm     untracked-file
git commit -q -m "1st line"  file
git checkout -b test
echo "added 2nd line in test" >> file 
git add file 
echo "2nd file" > file2
git add file2
echo "added 3nd line in file" >> file 
git add file
git commit -q -m "2nd and 3rd lines"
git checkout master
cat file 
echo "now added 2nd line in master" >> file 
git add file
git commit -q -m "2nd line"
git merge test
git-cat-file -p test:file > file
git add file 
git commit -q -m "merged"