gerrit git eclipse 集成心得

如下几步:

首先要在eclipse中安装git插件,此插件版本必须和elipse版本匹配,在git官网可以查看到对应版本

第一步:在本地安装git客户端,下载地址https://github.com/git-for-windows/git/releases/download/v2.13.0.windows.1/Git-2.13.0-64-bit.exe

安装之后,在工作目录中右击鼠标,点击git  brash here弹出git命令行  

输入ssh-keygen生成key


生成如下秘钥




  1. From the Terminal or Git Bash, run ssh-keygen
  2. Confirm the default path .ssh/id_rsa
  3. Enter a passphrase (recommended) or leave it blank.
    Remember this passphrase, as you will need it to unlock the
    key whenever you use it.
  4. Open ~/.ssh/id_rsa.pub and copy & paste the contents into
    the box below, then click on "Add".
    Note that id_rsa.pub is your public key and can be shared,
    while id_rsa is your private key and should be kept secret.
配置好公钥之后,在项目根目录下安装commit-msggit ,打开git命令行,在命令行中输入git clone ssh://[email protected]:29418/pmsas && scp -p -P 29418 [email protected]:hooks/commit-msg pmsas/.git/hooks/此地址,这个地址可以在如图地方获取



获取gerrit上的项目ssh地址进行项目下载到本地仓库



至此项目已经下载到本地仓库(我这里服务器上的项目只是一个空项目,需要对下载下来的空项目进行修改,我是把我本地的项目放到这个空项目中)


通过eclipse导入项目(import--》exsiting  projects  into  workplace )

导入之后,鼠标放到项目上右击,team --》commit


remote --》 push 提交到服务器




你可能感兴趣的:(gerrit git eclipse 集成心得)