Created
June 13, 2018 01:44
-
-
Save lovejavaee/6f398dbb2d3d7f1d4b38584337e86954 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Having to write | |
git pull origin branch_name | |
followed by | |
git add all -A | |
then | |
git commit -m "blaaah blaah" | |
was getting a bit annoying so I figured out how to combine these into a single command as most of the commits I make are quite straight forward. | |
First thing you need to do is find your .bash_profile which should be in your home/user directory (I’m using a MAC here, no idea where it would be for other OS’s). | |
Second, make sure you take a copy of it in case something screws up. | |
Then open it up and write this function in there. | |
gitty() { | |
git pull origin : ; | |
git add . ; | |
git commit -m "$1"; | |
git push ; | |
} | |
Save then file, quit and relaunch terminal. Now whenever you make a change to your git repo and want to commit something simply type | |
gitty "this is the commit message" | |
No more annoyance. What this function does is combine multiple commands at the same time. Simples. | |
PS – I call this gitty, but you could name it what ever you want. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment