-
Notifications
You must be signed in to change notification settings - Fork 0
/
git.sh
executable file
·56 lines (43 loc) · 929 Bytes
/
git.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
#!/bin/bash
User="VladVons"
Mail="[email protected]"
Url="https://github.com/$User/sh-conf.git"
GitAuth()
{
# sign with eMail 1
git config --global user.email $Mail
git config --global user.name $User
# no password.
git config --global credential.helper 'cache --timeout=360000'
}
GitSyncToServ()
# sync only changes from disk to server.
{
git status
#git add install.sh
#git rm TestClient.py
#git mv README.md README
#git log
git add -u -v
git commit -a -m "just commit"
git push -u origin master
}
GitFromServ()
# sync changes from server to disk
{
git pull
}
GitToServ()
# sync changes from disk to serv
{
# add all new files
git add -A -v
GitSyncToServ
}
#mkdir -p /admin/conf && rsync --update --recursive --links tr24.oster.com.ua::AdminFull /admin/conf
clear
#GitAuth
case $1 in
GitToServ|t) GitToServ "$2" "$3" ;;
GitFromServ|f) GitFromServ "$2" "$3" ;;
esac