I propose a let's learn thread where you post a topic you consistently find hard and the guys in the comments help you understand it better.
I start by mentioning that sometimes git checkout -b and setting up a new git branch to track a remote branch usually confuses me. I always have to Google how to do it. Even if I think I understood it last time. Is there a way you learned and understood this particular set of git commands?
Top comments (6)
For a long-time, I've defaulted to tracking branches. In 2.37.x (maybe 2.37.1) they introduced the following git config:
git config --global push.default current. Now, whenever you "push" you create a tracking branch.Underlying all of this is to create git functions that are aliases of the behavior I want.
I have a shell script name
git-author-countwith the following body:Now, I can run
git author-count(note that the-betweengitandauthor-countis gone). Why is that? Because if I have an executable script prefixed withgit-in my$PATH, I can then usegit <suffix>to run that command.The
$@is "all of the arguments I passed togit author-count".My dotzshrc bin directory has a lot of things. I also have several git aliases
Your dotzshrc is wayyyy bigger than mine. Pretty impressive
I do have a few more years on you to accumulate some cruft.
That is true.
I'm curious β do you find that it is the command you can't remember or the "concept" you have a hard time remembering?
It's the command. Cause I typically know what to search for to get the command, but I can never remember the command.