1、首先安装Git GUI。
2、配置运行Git Bash,在命令行中输入以下命令:
邮箱和账户名
打开androidstudio
配置git.exe的路径
点击Text测试。
配置GitHub的账户名和密码
点击Text测试
以上配置完成后,点击菜单中的VCS
创建关联的库,点击Share进行分享
点击ok提交代码
这样我们就把本地项目已经与github关联起来了,请看下图。左边的是用来更新github上面的项目的,右边是用来提交我们本地项目的
注意事项
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上面,解决办法如下图,第一个是设置邮箱地址,第二个是设置用户名。
至此就完成了。
本文详细介绍了如何在AndroidStudio中配置GitHub,包括安装GitGUI、配置GitBash、设置账户信息等步骤,并解决了初次配置时可能遇到的问题。
1896

被折叠的 条评论
为什么被折叠?



