- 安装git。
Git下载地址:https://git-scm.com/download
下载完成后安装,一路Next就好。
2.在androidstudio上设置github帐号。
File--settings--Version control --GitHub,Auth type选择password,输入帐号,点Test。
成功后有提示。
2. 配置git工具。
File--settings--Version control --Git,然后选择git的安装目录下bin 目录下的git.exe。
3. 然后Enable Version Control Integration,选择Git,点ok。之后update和commit按钮就变亮了。
4. 为项目添加Git版本控制,具体是方法是:(点击顺序) VCS-->>import info Version Control -->>Creat Git Repository...
5. 然后继续点击VCS-->>Import into Version Control -->>Share Project on Github
写上描述 看到选中的代码,提交完成后代码就传到Git上了
6.提交代码到gitHub
点击commit,再弹出的窗口上把鼠标滑到Commit那里,记住,不是点击
然后点击Commit and Push,开始提交到Github.
7. 更新代码
如果当前打开的就是正要同步的项目,直接点击Update就好。
如果当前打开的项目不是你要同步的这个项目,那么,请点击VCS-->>Checkout from Version Control-->>Git,找到github上的地址填进去,并选好本地路径,更新后打开。