
你想把自己studio里的工程分享到github上么?继续往下看
1.你得有个github账户
没有github账户??这怎么可以,作为一个逼格高点的coder必须有啊,分享几个
从0开始学习 GitHub 系列汇总
英文好的直接来着
2.安装git
- git的下载链接:戳这里,选择你的系统下载。

- 然后下一步傻瓜式安装,安装完成后在命令行里输入:"git" 测试,出现如下信息说明安装成功。

3.将git和github信息添加到android studio
- 进入File->Settings->Version Control->Git;将git安装路径添加到android studio,然后点击后面的“Test”按钮,如出现“Git executed successfully”对话框则添加成功。


- 进入File->Settings->Version Control->Github;将github信息添加到android studio,同样点击后面的“Test”按钮,如出现“Success”对话框则添加成功。


4.添加share时需要忽略的文件
和svn、git一样,再提交工程时都要忽略一些本地的临时产生的文件,在studio工程中有下面这些:
.idea文件夹
.gradle文件夹
所有的build文件夹
所有的.iml文件
local.properties文件
- 进入File->Settings->Version Control->Ignored Files;点击右上角的“+”弹出对话框,其中“Ignore specified file”为忽略制定文件、“Ignore all files under”为忽略制定文件夹、“Ignore all files matching”为忽略匹配文件。将上面的文件添加进去即可。

- 添加完大概是这样的,也不唯一,根据你自己的工程可能有差别。

5.分享工程到github
- 选择VCS->Import into Version Control->Share Project on GitHub,稍等片刻;

- 如下图,确认你的仓库名称,远程名称,填写该工程的描述信息后点击“Share”,继续稍等片刻;

- 出现下图,填写提交信息点击“OK”;

- 刷新你的github仓库会发现多了一个,此时工程分享完了;(欢迎关注我的github)


- 回到studio你会发现在VCS里会多出“Git”一项,此时你可以很方便的通过“Commit File”、“Pull”、“Push”等对该仓库远程操作。

网友评论