Android Studio Git 推送被拒绝 [英] Android Studio Git Push Rejected
问题描述
我正在尝试在 github 上上传我的 Android 项目,但在尝试推送时出现此错误:
推送被拒绝:推送到源/主被拒绝
我做了这个步骤:
- VCS->导入版本控制->创建新存储库...
来自项目文件夹中的 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屋!