Commits appear in yellow on all non-master branches.
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
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
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.
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.
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.
Any updates on this? Considering that GitHub uses main by default, it would be nice if default branch was configurable.
Agreed: this should be configurable on a per-repo basis. Happy to accept a PR for this and can give pointers if needed.
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.
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