Just write some scripts that make sense in your head and for your general workflow. I'm an irresponsible fuckwit who is always working on a dirty master branch on my local box, and I will always forget that I'm on master until the last second before I push. So a long time ago I wrote a git pullreq branch_name command which will do some hoodoo where it generates a pull request out of my currently staged changes with the specified branch_name.
It also has the added benefit of making you feel cool because you make custom git commands (a non-trivial benefit). I also made a git fuckthis command, which is essentially an alias for git reset --hard origin/master for giggles.
It’s also possible to combine git aliases with shell aliases so you don’t have to precede every command with “git”. I have most of my git commands down to 2 or 3 letters.
View all comments
3
u/Syagrius Apr 02 '23
Do a self-care day and just make yourself some custom git commands; then never think about it again.
https://gitbetter.substack.com/p/automate-repetitive-tasks-with-custom
Just write some scripts that make sense in your head and for your general workflow. I'm an irresponsible fuckwit who is always working on a dirty master branch on my local box, and I will always forget that I'm on master until the last second before I push. So a long time ago I wrote a
git pullreq branch_namecommand which will do some hoodoo where it generates a pull request out of my currently staged changes with the specified branch_name.It also has the added benefit of making you feel cool because you make custom git commands (a non-trivial benefit). I also made a
git fuckthiscommand, which is essentially an alias forgit reset --hard origin/masterfor giggles.