Git在Android Studio中的使用

来源:互联网 发布:淘宝开放平台 top 编辑:程序博客网 时间:2024/05/17 06:31

Android studio为我们提供了Git的插件,让我们能够很好的进行版本控制。

1.在studio中设置git安装路径:File->Setting->Version Control->Git, 然后可以点击Test测试一下,如下图:那么你就设置成功了。

2.初始化git项目(git init),操作如下:VCS->Enable Control Integration->Select "Git".

3.为git添加remote,在这一步中,studio没有为我们提供可视化的GUI,得用Git工具了。找到并打开git安装目录下面的Git Bash,将目录切换到项目的目录,然后输入git添加remote的命令,例如:git remote add origin "https://github.com/xxx/xxx.git".

4.将代码添加到VCS(git add),选中要提交的文件->VCS->Git->Add,


5.提交变化(git commit),VCS->Commit Changes,如下图,在提交的时候可以选择Commit and Push,就可以直接push到服务器。

6.Git Push,VCS->Git->Push.

最后,如果要是clone project到studio,如下图,


转载自:http://blog.csdn.net/hello0370/article/details/41899207?utm_source=tuicool

0 0
原创粉丝点击