-1

I can add my projects to one github account but with another account i can't. I have followed this website for GitHub and worked fine: https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/#comment-32683

Steps are: 1. create a new git repo. 2. from android studio- VCS> Import into version control> create git repo. 3. In windows root directory of project open bash command and type > git remote add origin https://github.com/xxx/myProject.git 4. then back to android studio and a)project>Git>add b)project>Git>Commit c) project>Git>repository>push

these steps worked fine and I get a successful message using one github account. But with another account i cant do it, i get the erro:

 Failed with error: fatal: unable to access 'https://github.com/Rashedul/myProject.git/': The requested URL returned error: 403

Why is this happening and how to solve it?

Rashedul Rough
  • 89
  • 1
  • 10
  • Possible duplicate of [Pushing to Git returning Error Code 403 fatal: HTTP request failed](https://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed) – phd Sep 22 '17 at 15:06

1 Answers1

0

First you should set username and password to access the URL and to login , set Authentication first.

git remote set-url origin https://yourusername@github.com/user/repo.git

Then you'll be asked for a password when trying to git push

This is on the http authentication format. You could set a password also:

https://youruser:password@github.com/user/repo.git

You should be aware that if you do this, your github password will be stored in plaintext in your .git directory, which is obviously undesirable.

Dharmishtha
  • 1,313
  • 10
  • 21