背景:重装了OSX,开发环境要重新设置
机器和软件:
1、centos服务器,上面有git仓库;
2、mac作为开发机器
3、git
4、eclipse
步骤:
1、在centos上搭建git服务器
参考:廖雪峰的文章:http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137583770360579bc4b458f044ce7afed3df579123eca000
2、管理公钥
参考:https://code.youkuaiyun.com/help/优快云_Code/code_support/FAQ_2_3
建议:生成密钥时候不用输入密码。
$ ssh-keygen -t rsa -C “您的邮箱地址”
记住您的邮箱地址,在eclipse中提交代码的时候会问你输入的
3、克隆服务器上的代码到某个目录,比如~/git/xxxx.git
$ cd ~/git
$ git clone git@server:/srv/xxxx.git
在eclipse中New-》Git-》Git Repository-》输入:~/git/xxxx.git
4、导入本地eclipse(带git插件)
a import
b projects from git
c existing local repository
d next》选择xxxx》next -》finish
完毕