上传方法:
http://blog.csdn.net/wangshushuo/article/details/42610719#comments
Can't push, because no remotes are defined问题解决方法:
http://stackoverflow.com/questions/22614715/cant-push-to-git-via-android-studio
别的不在多说。由于楼主上传没问题,仅仅遇到了 Can't push, because no remotes are defined问题,这里着重介绍下楼主怎么解决的。
按上面第二个链接里Wes Eklund所说的,在项目工程下找到 .git/directory,用记事本方式打开,在文件最后附加如下内容。
<code style="margin:0px; padding:0px; border:0px; vertical-align:baseline; font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif; white-space:inherit"><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent">[</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent">remote </span><span class="str" style="color:#8000;margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent">"origin"</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent">]</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent"> url </span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent">=</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent"> https</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent">:</span><span class="com" style="color:#808080;margin:0px; padding:0px; border:0px; vertical-align:baseline; background:transparent">//github.com/YOURPROFILE/YOURREPO.git</span></code>这里有个插曲。楼主的.git目录下没有发现directory文件。找了半天,最后决定死马当活马医,在config里添加了上述代码。事实证明我是对了~