Android Studio项目提交(更新)到github的两种方法

第一种方法:


第一步:配置github登录信息

打开如下路径File->Settings->Version Control(展开)->GitHub,如下图所示

Android Studio项目提交(更新)到github的两种方法_第1张图片

Login:你的github账户名

Password:你的github账户密码

填完之后点击test按钮,如果出现如下对话框说明配置成功

第二步:上传工程到github

打开你要上传的工程,顶部菜单选择VCS->Import into Version Control->Share Project on GitHub,如下图所示:


Android Studio项目提交(更新)到github的两种方法_第2张图片

如果你是第一次提交该项目会出现对话框,提示你这是一个新的存储库(repo),可以自定义repo的名字,和添加描述。

填写完毕点击share按钮如果你的工程没有问题这里列出了将要提交的类,以及各种资源配置文件等等,点击ok按钮

此时打开你的github网站地址在你的repositories中会看到刚刚提交过的工程名称,点击进去会看到完整的提交工程,到此提交结束


第二种方法:


使用git命令:

第一步:找到文件的根目录


Android Studio项目提交(更新)到github的两种方法_第3张图片

会看到这个页面然后右键:


Android Studio项目提交(更新)到github的两种方法_第4张图片

选中项目右键 :  git  bash 会看到这个画面


Android Studio项目提交(更新)到github的两种方法_第5张图片

第二步:git init


Android Studio项目提交(更新)到github的两种方法_第6张图片

点开项目会看到这个画面


Android Studio项目提交(更新)到github的两种方法_第7张图片

点击add root  会发现项目中文件变成另外一种颜色  可以选择git add 


Android Studio项目提交(更新)到github的两种方法_第8张图片


Android Studio项目提交(更新)到github的两种方法_第9张图片


Android Studio项目提交(更新)到github的两种方法_第10张图片

提交成功 回到github 会看到这个画面


Android Studio项目提交(更新)到github的两种方法_第11张图片

你可能感兴趣的:(Android Studio项目提交(更新)到github的两种方法)