有网友说eclipse下使用github传不上去代码,今天有空做个简单教程:
首先,去github.com注册一个用户名,登录成功后,点击自己的名字进入控制面板

创建一个新的代码仓库(Repositories)

创建成功后便会得到你的仓库地址:
https://github.com/liangxiaobi/my_project.git
其实这个页面已经介绍了如何将代码提交到仓库,命令行下的:
touch README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/liangxiaobi/my_project.git git push -u origin master
下面我们打开Eclipse,前提是要安装git插件,打开Eclipse,的MarketPlace,搜索git,安装即可。
然后,选择你要共享的代码项目:
右键点击项目名称》Team >Share Project>Git:

选中Use or create repository in parent folder of project,就是在当前目录下创建git仓库

点击Create Repository 后,即完成本地仓库创建.
下面开始将代码上传到github.
首先,右键点击项目名称>Team>commit,将代码提交一下。
然后,选择Team>Remote>Push,将弹出远程服务器对话框:

输入开始得到的github,项目仓库地址,再输入自己在github上的用户名密码,继续:


选择仓库的位置等参考信息,点完成即可开始上传代码,稍候即可看到完成提示:

即可看到你的代码了.
完毕.