Android studio下的项目重定向至OSChina
2016-10-25 本文已影响71人
铝小亮
Android studio 默认的是提交代码到github上面的,那我们如何提交代码到自己的私有项目中呢?
国内比较主流的git私有仓库:
接下来就是如何将Android studio 中新建的工程提交到自己的私有仓库中了!
step 1:新建私有项目
![](https://img.haomeiwen.com/i1392702/38b67abf04347cd8.png)
step 2:新建本地项目
![](https://img.haomeiwen.com/i1392702/70a8d4be93f50cd6.png)
step 3:配置git
1、先下载 git 工具
2、安装 git
3、Android studio 配置 git
![](https://img.haomeiwen.com/i1392702/2da560d41fb0e92d.png)
step 4:提交代码
1、创建本地仓库
![](https://img.haomeiwen.com/i1392702/ec66b707a613585a.png)
2、clone 远程仓库
- 打开 Git Bash 工具
- 定位到项目目录下
- clone 远程仓库
- 输入用户名和密码
![](https://img.haomeiwen.com/i1392702/70a85319527bcc2b.png)
3、提交代码
- 定位到项目目录下
-
git status
→git add .
→git commit -m "xxx"
→git push origin master
- 输入用户名和密码,等待 push 完成
![](https://img.haomeiwen.com/i1392702/9827e5420ce790e8.png)
![](https://img.haomeiwen.com/i1392702/84139f5956036b0e.png)
完成
至此,代码上传完成,我们就可以在 Android studio 的 Version Control 中查看提交日志了!