-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathautomate_commit.sh
More file actions
61 lines (43 loc) · 939 Bytes
/
automate_commit.sh
File metadata and controls
61 lines (43 loc) · 939 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
# TO PUSH THE CHANGES
# cd /Users/brunoflaven/Documents/03_git/BlogArticlesExamples/
# ls -l
# sh automate_commit.sh
# CHECK THE SOURCE FILES
# TO GRAB THE NEW CONTENT
# cd /Users/brunoflaven/Documents/03_git/BlogArticlesExamples/
# git pull
### CONFIG ####
# REPO FOR GITHUB
REPO_NAME="/Users/brunoflaven/Documents/03_git/BlogArticlesExamples";
# DESCRIPTION FOR COMMIT
COMMENT="update files";
### // CONFIG ####
echo "*** Automating Git Add, Commit and Push ***"
# pwd
# ls -l
# add a line
echo
echo "--- variables"
echo
echo $REPO_NAME
echo $COMMENT
# add a line
echo
echo "--- script"
echo
echo "cd $REPO_NAME"
cd $REPO_NAME
echo
# check for status
git status
# for any change just type this command
git add .
# add a commit with a message
git commit -am "$COMMENT"
# push to github if your branch on github is main
# git push origin main
git push origin master
# cd $REPO_NAME
### --- DONE --- ###
exit 0;