bash-example icon indicating copy to clipboard operation
bash-example copied to clipboard

Update default branch from master to main

Open AlexB52 opened this issue 3 years ago • 4 comments

Hi Buildkite :wave:

I'm going through the getting started guide and created my first agent with the bash example. I encountered a hurdle when running my first build. The pipeline defaults expect main as the default branch but only master exists on this repository.

I think two things can be done here to get your documentation in sync with the example repositories:

  1. We could update repository's default to main
  2. We could tweak the getting started documentation a little bit on point number 5 of the section Add the sample pipeline (see screenshot below)

1. Default branch: main

My guess is that you now default all repository branches to main when creating pipelines (which is :+1:) but this repository still has master as the default and new users trying out agents don't necessarily know that. The other getting started repository powershell-example has main as its default branch so all good there.

Here are screenshots of the issue:

CleanShot 2021-11-07 at 13 09 31@2x CleanShot 2021-11-07 at 12 58 37@2x

2. Documentation update

The documentation seems to suggest that master is still the default for repositories and conflicts with Buildkite pipeline defaults. The doc could be updated to:

You can usually accept the defaults here. If your repository uses 'master' rather than 'main' branch, edit the Branch option. Select Create build. Buildkite takes you to the pipeline build.

Current documentation

CleanShot 2021-11-07 at 12 59 39@2x

AlexB52 avatar Nov 07 '21 00:11 AlexB52

I didn't mind figuring out why the example was failing; it helped me dig deeper faster. But it was confusing at first... and it doesn't look good for BuildKite that this issue is 5 months old and not addressed.

Yenwod avatar Apr 16 '22 14:04 Yenwod

I ran into the same issue, and it's now been a year since this was raised.

StevTechy avatar Nov 17 '22 14:11 StevTechy

I had the same issue. I was getting the error: Warning: Checkout failed! exit status 128

It was almost like a rite of passage, to find out that the default branch was wrong (master instead of main), based on the hint from: fatal: couldn't find remote ref main. My dumb ass took too long to realise it after running it 5 times, expecting the result to differ (deleting the pipeline and re-adding it via the button in the doc).

It works for the powershell-example test repository, but it hasn't been fixed in this repository yet.

Might be a blocker for new starters, but a little troubleshooting doesn't hurt too much I guess. More of a little annoying barrier to entry, especially when you start off and think that you're doing something wrong.

frankpengau avatar Dec 13 '22 01:12 frankpengau

Hi Everyone! Sorry to have let all your comments go in vain over the years since they were written! This is something we'll get better at. Reviewing the example repos and documentation is something my team is doing.

The default branch is now main :)

clbarrell avatar Aug 30 '23 04:08 clbarrell