HEAD of Cloud Source Repository is not pointing to any commit

1.2k Views Asked by At

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

1

There are 1 best solutions below

1
CamelCamelius On

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