Pushing code to google source repos error

1.8k views Asked by At

I am getting the following error when pushing changes to my cloud source repo..

remote: INVALID_ARGUMENT: Request contains an invalid argument.
remote: [type.googleapis.com/google.rpc.LocalizedMessage]
remote: locale: "en-US"
remote: message: "Invalid authentication credentials. Please generate a new identifier: https://source.developers.google.com/new-password"      
remote:
remote: [type.googleapis.com/google.rpc.RequestInfo]
remote: request_id: "xxxxx"
fatal: unable to access 'https://source.developers.google.com/p/xxx/repository/': The requested URL returned error: 400

I then go ahead to generate new password and store in .gitcookies file but I still get the same error.

2

There are 2 answers

2
Lance Armah-Abraham On BEST ANSWER

I solved this by generating a new .gitcookies identifier using the Generate new identifier link and executing the command (sample is below) given after authentication with my account with the command line.

git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
powershell -noprofile -nologo -command Write-Output ...

Initially because I saw powershell and all I used powershell and even git bash but they all did not work.

I found that for windows users, just copy the command for the windows users section and paste in windows command line and not powershell or git bash.

0
Sahil On

I think when working with multiple GCP account we encounters this problem even though we use the valid credentials.

Using VScode GUI faced the same problem. But when used the following traditional git CLI command it worked for me.

  1. git add --all
  2. git commit -m "commit message"
  3. git push