eclipse项目放到github

  一,下载git ,配置用户名和邮箱:
  git config --global user.name "name"
       git config --global user.email "[email protected]"
       如果已经配置了,可用git config --list确认


二,找到eclipse项目文件夹,初始化成本地仓库

  

      在空白处,右键,git bash here

     1)   git init  初始化

          

    2) touch .gitignore添加ignore文件

         

         注意,文件中多了.gitignore文件

         

         在.gitignore中添加    /bin/     忽略掉编译文件

        

       3)git add .

      4)git commit -m ''  注意第一次提交,提交信息建议写项目名,要不然圈住的地方会很丑陋

三,上github,配置公钥

        https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/001374385852170d9c7adf13c30429b9660d0eb689dd43a000

四,   在github中新建仓库

          1)

      

       2)建立后的页面

        

五, 本地仓库关联远程

      https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013752340242354807e192f02a44359908df8a5643103a000

      注意和廖雪峰不一样的是,我们在第四步初始化了README.md文件,相当于远程仓库已经被别人提交了东西,所以,我们需要git pull --rebase origin master

      1)  git remote add origin [email protected]:heyboom/offer.git   建议用ssh,要不然用https以后还得弹窗输入github密码?麻烦

           备注,

   

      2)   git pull --rebase orgin master 拉取README.md

      3)  git push -u origin master推送

    

       4)大功告成

           

六,回到eclipse,利用下它的插件

    由于已经配置了git。这里就直接从右键项目->team->share project开始了。

             更详细的了解,参见:https://blog.csdn.net/superxiaolong123/article/details/81189481

           

              

        点击finish,完成。可以看到,项目已经带了  仓库 的标志

          

 

         

猜你喜欢

转载自www.cnblogs.com/heyboom/p/10800325.html