3

Is there any way to configure the Cloud Source Repository to point the HEAD to the latest commit?

I created a new repository in Cloud Source Repositories and the HEAD is not pointing to anything in the remote repo (GCP) although inside my local repository the HEAD does point to the latest commit.

Even if I can see the content in the remote repository (Cloud Source Repositories), the HEAD is not pointing to any commit.

The procedure I used is:

  1. Create the remote repository in Cloud Source Repositories.
  2. Create encryption keys.
  3. Register keys in GCP.
  4. Register keys in my local environment.
  5. Create files, add changes, commit changes, push changes to the remote repository.

Local repo:

enter image description here

Remote repo's HEAD:

enter image description here

Remote repo's main branch:

enter image description here

CamelCamelius
  • 333
  • 2
  • 15
  • 3
    Google Cloud does not let you set the name stored in `HEAD`. It creates `HEAD` attached to the name `master` (with the name itself nonexistent as yet though), so if and when you ever create a branch `master`, that's the current branch. There are years-old outstanding requests for Google to do something about this: it looks like they never will. – torek Dec 21 '21 at 08:43

1 Answers1

4

It seems that Cloud Source Repositories autodetects the old naming convention for the main branch because the issue got resolved when I changed the name of the branch from main to master.

git branch -m main master
git push -u origin master
CamelCamelius
  • 333
  • 2
  • 15