-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_upload.sh
More file actions
executable file
·32 lines (24 loc) · 941 Bytes
/
git_upload.sh
File metadata and controls
executable file
·32 lines (24 loc) · 941 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
#!/bin/bash
# This is a script to automate the git add, commit and push operations ~
# ~ for this directory online repository.
# Author: panderior
# References: various
echo -e "\n ---------------------------------"
echo -e " <= Push to Github repo started =>"
echo -e " ---------------------------------\n"
echo -e "\n => pull and sync local and remote repo before push"
# pull and sync wz remote repo
git pull origin main
echo -e "\n => add file changes to staging area ... \n"
# add changes to git staging area
git add .
echo -e " => commit to local repo ... \n"
# commit changes to local repo
# the commit note is grabbed from the first argument when the script is ran
git commit -m "$1"
echo -e "\n => push to online repo ... \n"
# push local commit to online repo
git push -u origin main
echo -e "\n ---------------------------------"
echo -e " < Push to Github repo completed >"
echo -e " ---------------------------------\n"