Reputation: 282
I tried to follow this tutorial: https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/
But when I push it says Push rejected: Push to origin/master was rejected
I suspect is it the reason of remote add? if my project path is https://github.com/myusername/projectname My remote add should add github.com/myusername/projectname.git?
Upvotes: 1
Views: 4087
Reputation: 1477
First, check if you inited the local git repository in your project's root directory.
Then check if you correctly added your remote origin.
Check the remotes:
git remote -v
If the existing remote origin is wrong, then change it:
git remote set-url origin https://github.com/myusername/projectname.git
If it's not existing, add it:
git remote add origin https://github.com/myusername/projectname.git
Upvotes: 2