Is there a way to associate a note or something with a git branch? All of my git branch names are absolute garbage because I don't want to type much when switching. But now I have a zillion branches and don't know what they're for. I'd be willing to at least write a message when making a new branch (as a note to myself)

I put nice commit messages on branches, but I can't remember the larger context 😭

7
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Ivan

@tenderlove I use fish which supports tab completing git branch names out of the box. Not what you are asking for here, but it helps me use longer names since I don’t have to type much of the name when switching branches

0
4mo
Steven Harman

@tenderlove git does branch name completion, no? Or do I have something in my zshell config to enable that? It’s been this way for me so long I honestly cannot remember.

Anyhow, tab-to-trigger brand name completion doesn’t work for you? Or is insufficient?

1
4mo
Jonathan del Strother

@tenderlove you could maybe use `git notes add` to attach a note to a commit on that branch, and then write something to liist notes on a branch (eg based on stackoverflow.com/questions/20)..?
It’s a shame no-one uses git notes

0
4mo
James :ruby:

@tenderlove

# Add description to current branch
git branch --edit-description

# View description of current branch
git config --get "branch.$(git rev-parse --abbrev-ref HEAD).description"

git-scm.com/docs/git-branch#Do

1
4mo
Andrew Novo

@tenderlove You could use jira and associate all your branches with jira tickets!! 💯

0
4mo
Kurt Werle

@tenderlove You type while switching? I use vscode, zsh, and gitx. vscode and zsh both do autocompletion - so I just type the important part of the branch name and they fill the rest. GitX is just clicky clicky. So when I name it's "something_about_the_foo_model". Then when I check out it's just "foo" and autocomplete. Bonus: I then often see if someone else is working on foo - if they named their branches well.

0
4mo
Replies