If I see a git thread, I tend to semi-spam my git aliases because so few people realize that they can customize git's command line behaviour.
Yeah I am just finding it hard to believe that there are so many people who don't. Maybe we are 10x engineers w.r.t. git aliases. Congratulations
Most tech folks in IT that I've known tend to just accept defaults, whether they're in vscode, a command line, or joining a new project. They don't seem to think in terms of "this is annoying/inefficient, how can I make it better?"
I should get "10x engineer with my git aliases" put onto a t-shirt :)
These should be aliases in your git config. git config --global alias. I'm really trying to understand, and not to be too negative. I get coming up with a solution to a problem, and finding it neat locally. But before posting to HN, one might realize that these solutions that git provides existing tools for is better than maintaining this. I'm also confused by all the comments just blindly commenting in the affirmati…
The trouble is that git aliases aren't composable and you can't install them. Each installation has its own aliases. If you are in a new machine you must define the aliases yourself. This also makes git aliases have poor discoverability.
Compare this with another tool that lets people extend its own command, cargo. You can do cargo install and then run cargo .
These should be aliases in your git config. git config --global alias. I'm really trying to understand, and not to be too negative. I get coming up with a solution to a problem, and finding it neat locally. But before posting to HN, one might realize that these solutions that git provides existing tools for is better than maintaining this. I'm also confused by all the comments just blindly commenting in the affirmati…
But before posting to HN, one might realize that these solutions that git provides existing tools for is better than maintaining this.
One might. But not everybody knows about those existing tools. Taking myself as an example: I've been using Git since nearly the time it was released and I had no idea that git had aliasing built in. Sometimes things just never come up and people don't find out about them. shrug
These should be aliases in your git config. git config --global alias. I'm really trying to understand, and not to be too negative. I get coming up with a solution to a problem, and finding it neat locally. But before posting to HN, one might realize that these solutions that git provides existing tools for is better than maintaining this. I'm also confused by all the comments just blindly commenting in the affirmati…
What would the alias command be for
git-delete-gone-branches
?
EDIT: I saw your other comment (incorrectly) claiming that git remote prune origin will do the job. I don't know of any git trickery that can do the job. And believe me I'd love it if there was something.
"git-delete-gone-branches" is exactly what I've been needing, will give it a try soon!
"git delete gone branches" is a one liner that you can google. first stack overflow result gives you the answer: git remote prune origin Why would you use this 50 line script to do the same?
This only removes references to remote branches. See e.g. [0]. The command in OP operates on local branches.
These should be aliases in your git config. git config --global alias. I'm really trying to understand, and not to be too negative. I get coming up with a solution to a problem, and finding it neat locally. But before posting to HN, one might realize that these solutions that git provides existing tools for is better than maintaining this. I'm also confused by all the comments just blindly commenting in the affirmati…
What would the alias command be for git-delete-gone-branches ? EDIT: I saw your other comment (incorrectly) claiming that git remote prune origin will do the job. I don't know of any git trickery that can do the job. And believe me I'd love it if there was something.
I have an alias "git prune-branches" that deletes branches that remote has deleted. Is that what you are loking for? Cannot check the code right now but will try to get back tomorrow.
These should be aliases in your git config. git config --global alias. I'm really trying to understand, and not to be too negative. I get coming up with a solution to a problem, and finding it neat locally. But before posting to HN, one might realize that these solutions that git provides existing tools for is better than maintaining this. I'm also confused by all the comments just blindly commenting in the affirmati…
Hi! Author here. Some of these can indeed be an alias, others.. not so much. `git-root` for example is more-or-less a one-liner, meanwhile `git-mode-restore` is a ~840 loc python script.
I do use git aliases but trying to do anything non-trivial in them seems rather counter-productive so I'm confused about everyone suggesting it :P
What would the alias command be for git-delete-gone-branches ? EDIT: I saw your other comment (incorrectly) claiming that git remote prune origin will do the job. I don't know of any git trickery that can do the job. And believe me I'd love it if there was something.
I have an alias "git prune-branches" that deletes branches that remote has deleted. Is that what you are loking for? Cannot check the code right now but will try to get back tomorrow.
If you're willing to report back I'd be very grateful.