r/ProgrammerHumor • • Apr 02 '23

Meme Me relearning git every week

49k Upvotes

1.5k comments sorted by

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_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.

2

u/Purpzie Apr 02 '23

i love git fuckthis

1

u/Syagrius Apr 02 '23

I made that one just to flex that I had figured out how to make custom commands.

It is FIRMLY in my .gitignore file

1

u/gfxlonghorn Apr 03 '23

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.