7

With GCP CSR, is it possible to change the default branch for a repository from master to something else? This doesn't have much bearing on functionality other than the branch that's first displayed in the CSR UI. However, it's something I can change in GitHub.

Chris Keller
  • 374
  • 2
  • 12

2 Answers2

9

No, you cannot change the default branch from master to something in Google Cloud Source repository. However, a trick that I use to reach my branch in the UI directly is by following this link:

https://source.cloud.google.com/<project-id>/<repo-name>/+/<branch-name>

Methkal Khalawi
  • 2,368
  • 1
  • 8
  • 13
  • 1
    There should be a colon at the end, otherwise you end up at the latest commit of that branch. So finish with `/:`, e.g. `/main:` – MEMark Sep 22 '21 at 05:48
  • Still true. [Google issue tracker](https://issuetracker.google.com/issues/168035627?pli=1) confirms this hasn't been resolved yet as for today. – Jacek J Jul 21 '23 at 20:35
-2
git config --global init.defaultBranch <name>

should do the trick

Pierre
  • 559
  • 9
  • 21