Cloud Source Repositories - Git Push code to the default branch or switch branches

790 Views Asked by At

I am new to git repositories. I tried my best to learn about it. I need to push a automation project to google repositories .I executed following comments to perform this.

$ git init
$ git add .
$ git commit -m "initial commit"
$ gcloud init && git config credential.helper gcloud.cmd
$ git remote add google https://source.developers.google.com/p/[PROJECT_NAME]/r/[REPO_NAME]
$ git push --all google

I managed to successfully pushed the project however it is not reflecting on the default branch of repository. When I navigate to the repository it shows

No commits on the default branch. Push code to the default branch or switch branches.

It looks like main is not a default branch ,there are multiple branches in the cloud

enter image description here

I tried to merge but still no improvement

$ git remote
google
$ git fetch
$ git checkout HEAD
Your branch is up to date with 'google/main'.
$ git merge main
Already up to date.

I need to merge my main branch to default branch on google cloud repositories. Please help

0

There are 0 best solutions below