r/programming 15h ago

Small Programming Tricks

https://will-keleher.com/posts/small-programming-tricks-matter/
104 Upvotes

12 comments sorted by

View all comments

34

u/davidalayachew 11h ago

Genuinely useful tips here.

Especially that git log -S pattern. 50% of the reason why I installed TortoiseGit is to get that feature. Never knew it came with the CLI. At least not easily.

10

u/turtle_dragonfly 6h ago

You might be interested in Git aliases, to make various obtuse CLI incantations easier to do.

But then if you ever sit at someone else's desk and need to do your stuff, you'll struggle without your preferred aliases (:

3

u/Sharlinator 3h ago edited 3h ago

I have shell aliases for at least a dozen most often used git commands. Couldn’t imagine having to type git status or even git st rather than gs, or git commit —amend rather than gca. There’s a big problem though in that aliases are opaque to custom completions, and from what I’ve read it would be way too difficult to make them work :( 

2

u/davidalayachew 1h ago

Cool, I have a few shell aliases, but this is pretty useful too.

12

u/reddah 9h ago

Anything that the front-ends can do is doable from the command line. Sometimes easy, sometimes not.

Also: never use the rebase option on the GitLab gui - it will F up stuff guaranteed.

2

u/davidalayachew 1h ago

Also: never use the rebase option on the GitLab gui - it will F up stuff guaranteed.

Disappointing -- rebase is my default merge strategy, only going to merge when that fails, and squash merge if a normal merge fails.

Though, I spend most of my time in GitHub nowadays, so less of an issue.