1

I am unable to push projects to Github using Android Studio. I created a new project as well as a new repository and tried pushing it to Github, but I am getting this error:

Failed with error: fatal: unable to access https://github.com/4lionintern/Test0000.git/: The requested URL returned error: 403

All the questions asked about this have been using git bash, but I am trying to use the commit changes button.

enter image description here

1

8 Answers 8

2

I had the same problem. I couldn't push to my own repository!

It was a problem with windows credentials.

  1. Go to: Control panel > User Accounts > credential manager

  2. select: windows credentials

  3. Remove all gitlab credentials you see in the list

  4. Add a generic credential with your gitlab account info:

Internet or network address: git:https://[email protected]

username: your gitlab username

password: your gitlab password

then try to push your changes to the repository again. It should work.

Sign up to request clarification or add additional context in comments.

Comments

1

You need to provide write permission to your team member
enter image description here go to member repository permission

Comments

0

403 means, that your credentials are wrong or not existing. How are you authenticating at Github? Via Username:Password or public Key. If you use public key, this is not possible via https.

Comments

0

Try to change the path of git URL from https to SSH, then to reload the project again. Then try to push. Also check credentials given in File>Settings>Version Control>Github

Comments

0

Go to project folder and Delete .git folder, then try again. If it does not work. Your repository URL may be wrong or the authentication problem.

1 Comment

After you delete .git folder, try to "Share project on GitHub". it will create a new repository on github and push your code over there..
0

HTTPS doesn't work with Android Studio. I tried re-initializing git using git bash.

In your root folder. Delete old non-working .git folder:

rm -rf .git 

Initialize a new empty Git repository. Then add files you want to commit

git init git add . 

Commit and push

git commit -m "first commit" git remote add origin [email protected]:YourNameHere/YourProjectName.git git push -u origin master 

After that, git should work in Android Studio.

  1. VCS > Git > Commit File...
  2. VCS > Git > Push

Comments

0

You need to first go to: Setting -->System Settings --> passwords --> Select Don't save password.

Next time when you click push, you will be asked for username and password for git repository.Enter your credentials and continue.Hope this helps.

Comments

0

Error 403 means : Access not granted. Means github has understood your request but denied your changes

The problem generally occurs when the gitbash account and the github credentials in your android studio do not match. You might have changed the username and password in your android studio but the account in the gitbash remains the same. So you should change the credentials of your gitbash in accordance to the android studio credentials. Change the gitbash credentials in accordance with the android studio credentials and it will definitely work.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.