5

I forked application to android studio and when I try to make a pull request:

enter image description here

I get :

Can't Create Pull Request
            Push failed:
            failed to push some refs to 'https://github.com/projectname.git'

What is the right way to do that?

Note :

I can commit and update my projects but I can't make pull request to other projects.

2 Answers2

1

This is obviously an authentication problem. There are WAY too many unknowns, so I doubt anyone can give you a definitive answer. Here are the steps to investigate in order to solve it:

  • Is your GitHub Account authenticated with your Android Studio installation? Check your Android Studio Settings.

enter image description here

  • In order to authenticate you need to generate an Access Token through your Github account settings and use that token as seen in the picture above. When generating a new token, normally I would advise you to be careful with the permissions you grant to it. For debugging your issue, generate a new one with full access to everything and delete it as soon as you resolve your issue.

enter image description here

  • Last, if both of the above steps are done correctly and you still can't open a PR. Make sure the repository you trying to open a PR on, allows third party users to perform such actions.

NOTE: You can always commit code in your local repository. That lives in your local environment (a.k.a. your computer) and you have full permission to do whatever you please with it. That doesn't mean the changes you do locally, will be reflected in the remote repository (a.k.a. the one hosted at Github servers).

DimitrisCBR
  • 2,483
  • 1
  • 17
  • 19
-2

First you need to install git client and configure with Android studio then you need to enable git into android studio from VCS option. and then you can see on toolbar 2 icon will come for push and pull request. by these two option you can do pull and push very easly.

please have look this. http://prntscr.com/hgvbxw

reference-https://javapapers.com/android/android-studio-git-tutorial/

Lovekush Vishwakarma
  • 3,035
  • 23
  • 25