I have been trying to log with a new corporate account in order to push some code in gcp Cloud Repository. Despite all my attempts at logging in with the new user, somehow when I issue git push
it still tells me
ERROR: Your current active account [old_email@domain.com] does not have any valid credentials
Please run:
$ gcloud auth login
to obtain new credentials.
For service account, please activate it first:
$ gcloud auth activate-service-account ACCOUNT
Run 'gcloud auth login' to log in.
Username for 'https://source.developers.google.com':
When I run gcloud auth list
only the new corporate email <new_corporate_email>@domain.com
is displayed.
Here are the steps I took
gcloud auth login
gcloud auth login --no-launch-browser
gcloud auth application-default login
gcloud config set account <new_corporate_email>@domain.com
git config --global user.email "<new_corporate_email>@domain.com"
Where is the current active account stored and how do I refresh its value? Could this be strictly a git
issue?
I suspected it was a problem with git and its relationship with gcloud
since I am using Google Cloud Source Repositories.
What I did was not solve this solution perse, but I offer you a workaround in case you get the same error. Here are the steps I applied to "fix" it:
gcloud
gcloud
rsync
commit
& push
and it worked