Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't push my project on GitHub using Android Studio

I can't perform the initial push of my Android project:

Can't finish GitHub sharing process
 Successfully created project '****' on GitHub, but initial push failed:
 Error: Could not find or load main class org.jetbrains.git4idea.http.GitAskPassApp
 unable to read askpass response from 'C:\Users\admin\AppData\Local\Temp\git-askpass-0.bat'
 failed to execute prompt script (exit code 1)
 could not read Username for 'https://github.com': No error
like image 963
Mihail Boiarskii Avatar asked May 27 '16 10:05

Mihail Boiarskii


People also ask

Why am I not able to push to GitHub?

Simply put, git cannot make the change on the remote without losing commits, so it refuses the push. Usually this is caused by another user pushing to the same branch. You can remedy this by fetching and merging the remote branch, or using pull to perform both at once.

Why my git push is not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.


2 Answers

I had the same problem, to solve this you run the following commands on git:

git config --global user.email "[email protected]"

git config --global user.name "Your Name"
like image 178
ChamCham Avatar answered Oct 22 '22 05:10

ChamCham


Before you start working on android studio , register your username and user-email on git bash.(that's where the error is coming from).
focus on phase - xx below , but if you haven't done 1 & 2 go through them as well . Also , you can check phase 4 , 5.

Phase 1- github.com register with username , user-email and password.

Phase 2 - git-scm.com/downloads with selections as -get desktop icon , use git from git bash only , check out windows style ,use mintty .....

Phase xx-
In git bash ,type where your current cursor is:-

git config --global user.name "jamesbond"
Press enter
Type (don't undo the previous step) where your cursor is again...
git config --global user.email "[email protected]"
Press enter
And leave it just like that.
Notes(for phase xx) :--
Again , do work on gitbash before you start opening android studio .
You have to enter your username and password(of github.com account) instead of jamesbond.

Be careful with spacing and all small letters.

phase 4 --in android studio click on
Vcs--> import into version control -->share project on github. ---> you can give description and press share.--> make sure all files are checked and can add commit message and press ok.--> you should be the getting a success message.

phase 5-- to check the real code
Open your github account at github.com---> you will find a box of your repositories ----> click on your project and keep clicking the further ones. --->app-->>src-->>main-->>java/edu/pushup (this may be different for you)-->> mainactivity.java and you will see your code...

like image 1
DALESH PRASHAR Avatar answered Oct 22 '22 04:10

DALESH PRASHAR