forked from 0w0n2/AlgorithmStudy25-02
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.sh
More file actions
22 lines (17 loc) · 766 Bytes
/
backup.sh
File metadata and controls
22 lines (17 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# 폴더 전체를 이전에 지정해둔 remote 주소(브랜치 = master)로 전체 백업하는 스크립트
# Usage (default / commit message : today's data) : ./backup.sh (Ex/ .backup.sh)
# If you want to use a custom commit message, uncomment line 20 and use "line 21".
# Usage 2 (for custom commit message) : ./backup.sh <commit message> (Ex/ .backup.sh 250116)
# git의 줄바꿈 설정을 변경(환경설정)
git config --global core.autocrlf false
# remote 주소 표시(걍 확인용)
git remote -v
# commit message = today's date
message=$(date +"%y%m%d")
echo "commit message : $message"
# backoff (push all files in this directory)
git add .
# git commit -m "$1"
git commit -m "$message"
git push origin +master