【转】eclipse使用git提交到osc

时间:2023-03-09 09:03:49
【转】eclipse使用git提交到osc

转自:http://my.oschina.net/gaowm/blog/271623

一、Git下载

在Windows上安装git,一般为msysgit,官网地址:http://git-scm.com/ 我下载的是Git-1.9.2-preview20140411.exe

二、Git安装

【转】eclipse使用git提交到osc

下载后,默认安装在c盘

【转】eclipse使用git提交到osc

在Windows Explorer integration选项中将“Git Bash here”和“Git GUI here”打对勾。

【转】eclipse使用git提交到osc

【转】eclipse使用git提交到osc

其他默认即可,然后安装完成

三、设置用户名和密码 

git config --global user.name "gaowenming"
 git config --global user.email "gaowm0207@163.com"

四、准备代码库

【转】eclipse使用git提交到osc

【转】eclipse使用git提交到osc

五、创建本地仓库

【转】eclipse使用git提交到osc

如上图所示,在本地的e盘gittest目录下就创建了本地仓库

六、eclipse提交项目

share project

【转】eclipse使用git提交到osc

选择本地仓库

【转】eclipse使用git提交到osc

点击finish之后,项目如下

【转】eclipse使用git提交到osc

七、提交到本地仓库

【转】eclipse使用git提交到osc

八、本地仓库推送到远程仓库

【转】eclipse使用git提交到osc

选择远程仓库

【转】eclipse使用git提交到osc

【转】eclipse使用git提交到osc


【转】eclipse使用git提交到osc

【转】eclipse使用git提交到osc

这时候可以去看看远程仓库中,已经可以看见我们提交上去的项目了

【转】eclipse使用git提交到osc

查看远程仓库的代码

【转】eclipse使用git提交到osc

至此,我们就完成了把本地项目提交到osc的git远程仓库中了!