ToolGit: A collection of scripts that extend Git with various sub-commands
51–59 of 59 posts
Re: ToolGit: A collection of scripts that extend Git with various sub-commands
#52These 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…
Why do you disagree with this early decision from git?
Re: ToolGit: A collection of scripts that extend Git with various sub-commands
#53Earlier quoted context omitted.
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.
Thanks for keeping me honest. I just read the first line of the stackoverflow, but the one liner is still in the comments. I just tested it. https://stackoverflow.com/questions/7726949/remove-tracking-... git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
The script in OP handles that edge case by switching to the main branch before deleting. That may or may not be intuitive but I think it's a reasonable response. The script also prints error messages for various other bad inputs. Once you strip all that out it's only a few lines long.
Re: ToolGit: A collection of scripts that extend Git with various sub-commands
#54These 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…
I looked at 1/3 of the scripts and not one _adds_ functionality, they only add interfaces for existing functionality.
I hate to say this but I feel like this post got upvoted simply for being hit-adjacent.
I wonder if voting on the front page is a bad setup.
Re: ToolGit: A collection of scripts that extend Git with various sub-commands
#55Earlier quoted context omitted.
Thanks for keeping me honest. I just read the first line of the stackoverflow, but the one liner is still in the comments. I just tested it. https://stackoverflow.com/questions/7726949/remove-tracking-... git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
That looks fine and will generally work, except when the current branch is one of the ones to be deleted. The script in OP handles that edge case by switching to the main branch before deleting. That may or may not be intuitive but I think it's a reasonable response. The script also prints error messages for various other bad inputs. Once you strip all that out it's only a few lines long.
Re: ToolGit: A collection of scripts that extend Git with various sub-commands
#56Maybe someone will find it useful :).
Re: ToolGit: A collection of scripts that extend Git with various sub-commands
#57Earlier quoted context omitted.
That looks fine and will generally work, except when the current branch is one of the ones to be deleted. The script in OP handles that edge case by switching to the main branch before deleting. That may or may not be intuitive but I think it's a reasonable response. The script also prints error messages for various other bad inputs. Once you strip all that out it's only a few lines long.
I'm going to assume you have about as many years of experience as me based on your profile, but if you're going to argue that maintaining this script - for the sole convenience of deleting a branch out from underneath you - is worth it, then there's nothing more I can do to help you.
Re: ToolGit: A collection of scripts that extend Git with various sub-commands
#58This needs a “git-track”. Make the current branch track the one in origin with the same name, if it exists
In oh-my-zsh you have `ggsup` which is an alias for `git branch --set-upstream-to=origin/$(git_current_branch)`. `git_current_branch` is also a function that is bundled with oh my zsh.
git config --global alias.track '!git branch -u origin/$(git branch --show-current)'
Re: ToolGit: A collection of scripts that extend Git with various sub-commands
#59https://gist.github.com/romainl/a3ddb1d08764b93183260f8cdf0f... This script in your path means that after you say pull code and have merge conflicts, "git jump" will open vim with the quickfix list populated with the locations of the conflicts.
Jump is distributed under /usr/share/git-core/contrib or something.