Created
July 18, 2021 14:28
-
-
Save ThePyProgrammer/3480f781b7423eb35786c1c423be19c9 to your computer and use it in GitHub Desktop.
A simple shell script to run commits in a single line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First let's check the status | |
git status | |
# We now add the file as in the arguments | |
for i in $(seq 2 $#); | |
do git add ${!i}; | |
done | |
# Commit files based on first argument | |
git commit -m "$1" | |
# Push repo to origin | |
git push origin | |
# Check status again | |
git status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is actually really unnecessary.
I guess the best way to code this is as follows:
In your
~/.bashrc
:Then in Git Bash:
$ commit "<commit message>" file1 file2 directory1/ directory2/