亲测git与github
1、安装MyEclipse 8.5,略去不表。
2、下载Eclipse的git插件——EGit。下载网址http://download.eclipse.org/egit/updates-1.3/org.eclipse.egit-updatesite-1.3.0.201202151440-r-site.zip ,
这是截至目前最新版的,如果想下更新版本,访问EGit的下载页面 http://www.eclipse.org/egit/download/ 即可。【本目录已经下载好了,迅雷,新的版本反而不行,试过了】
3、安装插件:把上一步下载的插件解压出来,删掉XML文件。在MyEclipse的dropins目录下新建一个egit文件夹,
然后把刚才解压的features、plugins和另外两个jar包全放进去。重启MyEclipse后,进入window-preferences-team,看到Git选项,就说明安装成功了。【说明:eclipse和MyEclipse好像都默认安装了,若没有,Eclipse中安装新软件那里输入“egit”】
4、
设置一下你的SSH Key信息,这步很重要,否则项目是提交不上去的。
从你的开始菜单里打开Git Bash。
在$提示符后面,输入 ssh-keygen -t rsa -C "your_email@youremail.com" 回车,注意:ssh-keygen是连着写的,中间没有空格。
这时候系统会提示你一些问题,比如passphrase什么的,一路回车过去就行了。
最后系统会生成一个id_rsa.pub文件,里面就是你的SSH Key了。这个文件默认是存放在C:\Documents and Settings\Administrator\.ssh文件夹里。【注:方法一:其实用github的git shell 复制上面的语句,修改email,然后就可以知道具体位置了,如本次亲测是在C:\Users\USER\.ssh下面的文件,gitshell会有提示的下载位置
方法二:在git下面输入 ssh-keygen -t rsa -C ""your_email@youremail.com" 同样可以得到】
进入Github网站,在 https://github.com/settings/ssh 页面中,点击“ADD SSH KEY”按钮,把id_rsa.pub文件里的内容复制到里面,title随便写个就行。
把C:\Documents and Settings\Administrator\.ssh 里的东西全复制到C:\Documents and Settings\Administrator\ssh里。
至此,SSH Key就设置好了。
5、
你也可以通过 终端输入查看自己与github 的链接状况
ssh -T git@github.com
如果链接成功会出现
Hi jia349934570! You've successfully authenticated, but GitHub does not provide shell access.
OK 前期的准备工作差不多了
6、
$git config --global user.name"你的用户名" 注:可以不是你帐号
$git config --global user.email"你的email" 注:注册的帐号
$cd c://prj//helloworld 注:就是你从myeclipse里创建的工程目录 【注意:远程github必须也要有一个相应的文件夹】
$git init
$touch README
$git add README
$git commit -m 'first commit'
$git remote add origin git@github.com:bluewelkin/helloworld.git 【注意origin与git有空格】
$git push –u origin master
7、上传的时候,先team→commit→pushi
相关文章
- 【问题解决方案】git/github本地和远程仓库的重命名
- [Practical Git] Show who changed a line last with git blame
- 用 Github、Markdown 和 GitBook 写开源书
- [Git] Use git add --patch for better commit history and mitigating bugs
- [Practical Git] Format commit history with git log arguments
- github使用和推送到服务器端。。。
- 使用代码将github仓库里某个issue同步到CSDN博客上
- github page 和 hexo 搭建在线博客
- 使用Github Pages和Hexo构建个人博客
- 再谈git和github-深入理解-2
- Git 删除 GitHub仓库的文件——详细操作 githua如何删除文件
- 解决办法:git错误 error: failed to push some refs to 'https://github.com/...
- 使用 Git 向 Gitee/Github 提交代码时被拒绝【已解决】
- Hexo+GithubPage搭建Fan主题的博客(1)基础准备及Github仓库配置
- Android的报错提示:Failed to resolve: com.github.bumptech.glide:glide:4.9.0
- Github PageHelper 原理解析
- [Git & GitHub] 合并多个commit
- 首次将IDEA中的项目上传到Github / Share Project on GitHub