I was chatting to a mate over a coffee this morning about how I’ve been automating some of my repetitive command line tasks, I thought it would be worth sharing a few handy git aliases that I use in my development workflow.
Git Commit (gc)
These days I’m constantly committing code as features are completed or bugs are fixed, as this is a very repetitive command line process I figured I could automate some of these steps to save time & increase my productivity.
This alias is essentially a simple bash function that runs a few repetitive tasks such as:
- It runs ‘git status’ (to remind me which files have been added / modified )
- I then runs ‘git commit’ (adding all modified files in all directories)
- It then asks you to enter a commit message
- It then runs a git push
Other git aliases
Here are a couple of other aliases that I use on a regular basis
- gs = Git Status (in the minimised output)
- gp = Git Push
- gremove = Removes the git repo from the current directory (use with care).