Android Studio Git推送被拒绝 [英] Android Studio Git Push Rejected
问题描述
我试图在github上上传我的Android项目,但是当我尝试推送时出现这个错误:
推送拒绝:推送到原产地/主人被拒绝
我做了这个步骤:
- VCS->导入到版本控制 - >创建新存储库...
-
从Project中的git bash文件夹:
git remote add origin
之后,您可以 Git> Push 没有问题。
I'm trying to uploading my Android Project on github but I get this error when I try to push:
Push rejected: Push to origin/master was rejected
I made this steps:
- VCS->Import into version control->Create new repository...
From the git bash in Project folder:
git remote add origin https://github.com/[username]/[project_name].git
Git->Add
Git-> Commit directory
Git-> Push
解决方案As suggested in the comments you should pull the changes first, if you are working on a new repository that could happened when you create your remote repo with a readme or a licence file. To pull the changes from the user interface you should use, VCS > Git > Pull then select the master branch (depends)
after that you can Git > Push without problem.
这篇关于Android Studio Git推送被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!