AndroidStudio 中使用Git分享项目
来源:互联网 发布:java junit自动化测试 编辑:程序博客网 时间:2024/06/05 11:15
作者:世锋日上链接:http://www.jianshu.com/p/8e99c90ea12d來源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。前提条件 :
- 安装 Git 客户端 下载链接
- 有 GitHub 账号
- 安装了AndroidStudio
1. 在AndroidStudio中新建一个项目(这个不能不知道吧!)
2. 设置: Settings -> Version Control -> Git , 设置git目录, 点击Test测试, 如果成功会有Success提示
3. 设置: Settring -> VersionControl -> GitHub ,设置自己的github账号, 密码, 点击Test测试, 如果成功会有Success提示
4. 分享项目: VCS -> Import into Version Control -> Share Project on GitHub, 点击之后开始设置 repository name(如果你有设置过MasterPassword 会弹出对话框让填入密码.)
点击Share之后, 你就可以在GitHub上看到新的仓库
同时在AndroidStudio中 CVS下也可以看到版本控制 Git:
这样就已经设置成功
注意:如果分享项目出现如下错误:Can’t finish GitHub sharing process Successfully created project ‘GitHubDemo’ on GitHub, but initial commit failed: * Please tell me who you are. Run git config –global user.email “you@example.com” git config –global user.name “Your Name” to set your account’s default identity. Omit –global to set the identity only in this repository. fatal: empty ident name (for ) not allowed during executing git -c core.quotepath=false commit -m “Initial commit xxx” –
说的很清楚,由于是初次配置的环境,没有配置好相应的一些必须的信息就会出现这样的错误。大致意思是需要一个名称才能提交到github上面,解决办法如下。 1. 在你安装Git的目录下找到git-cmd这个可执行文件 2. 设置邮箱地址,之后设置用户名。如下图:
5. 如果你想解除关联, 只需要 Settrings -> Version Control 删掉关联就可以了
6.项目更新当项目新增了模块或者模块修改了如何更新github上的项目,其实也很简单。1 如果你的项目新增了一个类,当你创建该类的时候会提示你是否需要加入git,如下图所示
选择yes该类就会加入git,同时该类本身的颜色会有改变(Darcula主题下由正常的白色变为绿色)
此时该类右击->Git->COmmit File... 出现如下对话框
填写 commit message 后点击Commit按钮,有可能会出现如下警告,忽略它点击Commit
再次右击->Git->Repository->Push,如下图所示
点击Push出现如下对话框,点击Pust按钮
此时打开你的github上的该项目源码,你会发现新增的类已经出现了
2 如果你的项目中某个类进行了修改需要重新提交; 右击该类->Git-Add
感觉这步没什么变化?其实不是,这步其实是吧该类加入到git中;以后的步骤和新增类的操作一样,这里不再赘述。
- AndroidStudio 中使用Git分享项目
- AndroidStudio 中使用Git分享项目
- AndroidStudio 中使用Git分享项目
- AndroidStudio 分享项目到 git
- androidstudio 中 使用git
- AndroidStudio中如何使用Git和Github管理项目
- AndroidStudio中使用Git上传项目到github
- AndroidStudio中使用Git上传项目到github
- AndroidStudio中使用Git上传项目到github
- AndroidStudio中Git的使用
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- AndroidStudio使用git上传项目到github
- Androidstudio使用Git创建项目流程
- NOIP 2011 选择客栈
- 深度学习应用大盘点
- 开源JavaMail项目已经迁移到GitHub
- Android studio中使用lambda
- HTML angular多选框
- AndroidStudio 中使用Git分享项目
- karma 基础配置
- linux下创建桌面启动器(类似于windows下创建桌面快捷方式)
- ListView自动抢夺焦点解决
- Linux下的网络环境配置(转)
- Spring学习总结——Spring实现AOP的多种方式
- 远程无法复制粘贴
- Ionic2:创建App启动页滑动欢迎界面
- 数据库开发技术 数据库层次设计之层次结构