fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

I've got so many local in-progress development branches in my git repos that I've come up with a bunch of git aliases/scripts to manage them.

'git rio' to rebase all branches against upstreams. If rebase fails on a branch, it'll call 'git todo-set', which will add a '-todo-YYYY-MM-DD' suffix to the branch name.

'git todo' lists all the todo branches in chronological order. And finally, after I've manually fixed the rebase conflicts, 'git todo-unset' removes the todo suffix.

Jani Nikula

I also have 'git prefix-branch <prefix>' to add '<prefix>/' to branch name. For example, 'git prefix-branch attic' to name the current branch 'attic/branch-name'.

I often use 'git prefix-branch delete' because AFAIK there isn't a neat way to delete the current branch. I thus move the branch to the recycle bin, so to speak, and throw them out later.

@jani Oh, I would be interested in the prefix stuff, are you willing to share it? We use it to prefix our branches with initials at work, but also another prefix if the repo has upstream developments to indicate "our" branches.

@f14h

I've thought about sharing the scripts before. It's just that I can live with the sharp edges myself, but I'm wary of handing them over to others. And I don't have the time to polish.

That said, the prefix script is really simple:

paste.debian.net/1361776/

(Pasted with a 90 day expiration.)

paste.debian.netdebian Pastezone

@f14h Would be nice to also be able to un-prefix a branch, but haven't gotten around to it either.

@jani thank you so much! Noted with the sharp edges :D It's more for inspiration/how something is done than exactly using it verbatim. And if not, I'm happy to either deal with the consequences or adjust/fix it myself.