forked from nelsonchung/sync_utility
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitcmd
More file actions
executable file
·56 lines (54 loc) · 1.38 KB
/
gitcmd
File metadata and controls
executable file
·56 lines (54 loc) · 1.38 KB
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
echo "1. 更新來自遠端的資訊: git pull"
echo "2. 同步本地端資料到遠端: git push"
echo "3. 無條件使用遠端的資訊: git reset --hard origin/master"
echo "4. 顯示log: git log --stat"
echo "5. 顯示Remote端repository: git remote show origin"
echo "6. 顯示上次改變的內容: git show"
echo "7. 合入patch: git apply"
echo "8. 設定Local端的資訊: git config user.name, git config user.email "
echo "9. 更新fork branch的資料: git checkout master, git pull upstream master and checkout back"
read option
case "$option" in
//"")
//;;
"1")
git pull
;;
"2")
git push
;;
"3")
git reset --hard origin/master
;;
"4")
git log --stat
;;
"5")
git remote show origin
;;
"6")
git show
;;
"7")
echo "Please input patch file"
read patch_file
git apply "$patch_file"
;;
"8")
echo "Please input the username"
read username
git config --global user.name "$username"
echo "Please input the email"
read email
git config --global user.email "$email"
;;
"9")
git checkout master
git pull upstream master
git checkout nelson_develop
;;
*)
echo "Not support"
exit 1
;;
esac