-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.sh
executable file
·56 lines (47 loc) · 1.23 KB
/
push.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
# general
echo '**/main.dSYM' > .gitignore
echo '**/.vscode' >> .gitignore
echo '**/.ipynb_checkpoints' >> .gitignore
echo '**/__pycache__' >> .gitignore
echo '**/.DS_Store' >> .gitignore
# cpp
echo 'cpp/bin' >> .gitignore
echo 'cpp/build' >> .gitignore
echo 'cpp/obj' >> .gitignore
echo 'cpp/lib/lib' >> .gitignore
# cuda
echo 'cuda/**/build' >> .gitignore
# pytorch
echo 'pytorch/libtorch' >> .gitignore
echo 'pytorch/**/build' >> .gitignore
echo 'pytorch/**/checkpoint' >> .gitignore
echo 'pytorch/**/*.out' >> .gitignore
echo '' >> .gitignore
echo '# ignore files greater than 100M' >> .gitignore
# linux
find * -size +100M | cat >> .gitignore
# windows
# forfiles /s /c "cmd /q /c if @fsize GTR 100000000 echo @relpath" >> .gitignore
# set time zone
# echo "$LC_TIME"
LC_TIME=en_US.utf8
# echo "$LC_TIME"
git config user.name "hdnhan"
git config user.email "[email protected]"
git config user.name
git config user.email
# add all untracked files
git add .
# commit with message datetime if message is null
if [ -z "$1" ]
then
# get current datetime in +7 timezone
date=$(TZ="UTC-7" date)
git commit -m "$date"
else
# * means the whole arguments/string
git commit -m "$*"
fi
git push -u origin master
# git push