fnc_mc_git.inc.sh
723 Bytes
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
#!/bin/bash
#
# @param string $1 git dir
# @param string $2 logfile (FILE exists and is writable)
#
mc_git_pull() {
gitdir=$1
logfile=$2
echo ''
echo '' >> $logfile
mc_log "git pull $gitdir" $logfile
mc_bashsu "cd $gitdir" 1
git branch | grep '*'
git branch | grep '*' >> $logfile
git status -s
mc_log "git status -s" $logfile
git status -s >> $logfile
git pull
#mc_bashsu "git log | grep -m 1 commit" 1
git log | grep -m 1 commit >> $logfile
git log | grep -m 1 Date
git log | grep -m 1 Date >> $logfile
echo '----------------------------' >> $logfile
}
mc_git_status() {
gitdir=$1
cd $gitdir
echo $gitdir
git status -s
git branch | grep '*'
echo '----------------------------'
}