lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Commits appear in yellow on all non-master branches.

Open chriscn opened this issue 5 years ago • 6 comments

Describe the bug Within the 'Commits' section, if you are on a non-master branch they appear in orange. However often I have develop setup as my default branch (git-flow for example).

To Reproduce Create a repo with a non-master branch (even if it is the only branch) and the commit colour will appear in orange not green.

Expected behavior The default branch, (the first oldest one) should have green rather than orange

chriscn avatar Apr 30 '20 20:04 chriscn

Interesting. I wonder how you would ask git which is the default branch, or whether it has a concept of that. I also wonder how we'd determine what the oldest branch is. If we can't, we could make this a configurable thing or even an in-app thing like a 'set as default' option

jesseduffield avatar Aug 23 '20 12:08 jesseduffield

What if…

  • red: topic branch commits, not pushed
  • yellow: topic branch commits, pushed
  • green: base branch commits

That'd be helpful when working with a stack of PRs too… we often do that at my work when we get to a nice point to review but want to move on assuming the review will be largely OK, or want to incorporate someone else's work that's currently waiting in the merge queue.

BrianHicks avatar Aug 23 '20 12:08 BrianHicks

What if…

  • red: topic branch commits, not pushed
  • yellow: topic branch commits, pushed
  • green: base branch commits

That'd be helpful when working with a stack of PRs too… we often do that at my work when we get to a nice point to review but want to move on assuming the review will be largely OK, or want to incorporate someone else's work that's currently waiting in the merge queue.

Seems fine to me, but I also like to see what's not in the "default" branch (now it's master but I like the idea of set it to another branch, like develop). So.. for that it seems we would need more colours or just a way to setup this "default branch" on-the-fly.

jonpoveda avatar Jun 28 '21 08:06 jonpoveda

main vs master - using main makes sense as a default branch name, and is the default branch name for any new repo on github. I'd be nice to see that 'default' branch change to main, or be configurable.

dgdosen avatar Sep 19 '21 14:09 dgdosen

Any updates on this? Considering that GitHub uses main by default, it would be nice if default branch was configurable.

Rizhiy avatar Sep 07 '22 20:09 Rizhiy

Agreed: this should be configurable on a per-repo basis. Happy to accept a PR for this and can give pointers if needed.

jesseduffield avatar Sep 07 '22 21:09 jesseduffield

Taking a look at this again - I think that we should be renaming the initial branch and hence the green colour should be associated with main as that is the GitHub standard.

chriscn avatar May 08 '23 13:05 chriscn

This is fixed on master now. By default we handle both master and main, but you can configure to use more via the git.mainBranches config (see docs) for an example.

We do not yet allow you to specify the desired branches on a per-repo basis, but if your repo has some main branch that is neither master nor main, you can still include it in the mainBranches array that applies at the top level and if the branch is present it'll be used.

I'll close this off. If you want a per-repo configuration for this, please create a new issue

jesseduffield avatar May 17 '23 06:05 jesseduffield