简体   繁体   中英

Android github commits to the wrong URL

I cannot find the setting to change this in Android studio. I just want to change the URL which android studio attempts to commit to. Currently I get a 403 error because I cannot commit to this repository (I am continuing work on an existing project which used to be stored at the URL shown).

My username and password are set correctly in settings > version control > github but I have no idea where to change this URL, it doesn't seem to be in the same place

Error message

EDIT: Screenshot of my congif --list and remote -v. Which doesnt match the url android studio uses.

http://imgur.com/a/n0EYr

In android studio, you can change remote URLs without using the command line from VCS > Git > Remotes .

Alternatively, you can set the remote from the command line with git remote set-url origin git@github.com:USER/REPO.git . If you are using https, which it looks like you are, the url will be https://github.com/USER/REPO.git

According to this link here , you need to open a command shell in your project directory and type this:

git remote set-url origin git@github.com:USERNAME/REPOSITORY.git

If you're using https, just replace the SSH url with the https url.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM