I've been writing some toy code for myself, there is a habit of submitting backups to GitHub, because this is my own code for the toy, and does not involve multiple branches, so each time it is mechanical to knock a string of the same command, in order to improve productivity, in the MAC UNIX environment to write a bash script, Every time I submit the automation to GitHub, I only need to execute this script on the line, the following gives the source code:
#!/bin/bash
echo "Start git add commit fetch merge Push"
echo "git add-a" git
add-a
echo git commit-m ' leetcode-louyuting ' "Git
commit-m ' leetcode-louyuting '
echo" Git fetch origin master
git fetch origin Master
echo "git merge Origin/master"
git merge origin/master
echo "Git push Origin master:master"
git Push Origin Master:master
This script has greatly submitted my productivity. Improved
The script above cannot set up a commit annotation with a unified annotation, so the following optimizations are followed by a dynamic setting of a commit annotation script as follows:
#!/bin/bash echo "git Add." echo "Git" Commit "echo" Enter the comment information for the commit: "comment=" commit new code "read comment git commit-m" $comment "echo" Git fetch Origin master "Git fetch origin master echo" git merge origin/master "git merge origin/master echo" Git Push origin mast Er:master "Git push origin master:master