github :
1. 打开 https://github.com官网,注册账户
2. Start a project --》create a new pepository
3.配置ssh
在gitbase中 ssh-keygen -t rsa -C "your_email@youremail.com"
后面的your_email@youremail.com
改为你在github上注册的邮箱,之后会要求确认路径和输入密码,
我们这使用默认的一路回车就行。成功的话会在~/
下生成.ssh
文件夹(我的地址C:\Users\Administrator\.ssh),进去,打开id_rsa.pub
,复制里面的key
。
回到github上,进入 Account Settings(账户配置),左边选择SSH Keys,Add SSH Key,title随便填,粘贴在你电脑上生成的key。
git :
1.下载git 一直下一步安装完成
2.studio---Setting---version control---git--Path to git executable 选择你刚才安装git目录中的 bin/git.ext(注意是bin目录下的git.ext),然后Text
3.studio-- VCS-->Enable Version Control Integration 选择git 点击OK 你的项目根目中有 .git 说明成功
4. Git安装目录中打开git base 然后切换到项目的根目录输入 git remote add origin git@github.com:yourName/yourRepo.git
这个时候去studio--git--add或者commit 远程库是被拒绝的
1. git push -u origin master 如果报错 本地项目根目录是否有README.md
2.git pull --rebase origin master 然后 git push -u origin master 即可