Windows安装gerrit工具方法

  1. 安装Python,python版本最好选择稳定版本,已验证版本2.7.11 [python2.7.11以上版本自带安装了pip,能够省略步骤4至步骤5]
  2. 安装Python时,指定的安装路径不能含有空格(已知的Pip Bug)
  3. 安装完Python后,须要将Python的安装路径添加到系统环境变量Path里(Python安装路径如:C:\Python27)
  4. 下载get-pip.py文件,下载地址:https://bootstrap.pypa.io/get-pip.py
  5. 右键选择打开"git bash",进入bash终端后,执行下面命令: python get-pip.py
  6. 安装完Pip后,须要将Python的Scripts路径添加到系统环境变量Path里(Scripts安装路径如:C:\Python27\Scripts)
  7. 关闭打开的git bash终端,再从新打开一个新的git bash终端,执行下面命令安装git-review: pip install git-review
  8. git-review安装完成后,关闭git bash终端
  9. 在Linux下生成一对秘钥(可使用已有的秘钥),放在C:\Users\Administrator.ssh目录下(请根据登陆windows用户,来肯定存放的目录) [步骤9可换成:在git bash终端执行ssh-keygen -t rsa -C "xxxxxx@yy.com" #建议填写本身真实有效的邮箱地址]
  10. 将生成的公钥信息添加到review.xxxx.com对应用户的SSH Public Keys里
  11. git clone测试仓库,地址:git@git.xxxx.com:project/gerrit_sample.git
  12. 在git clone的gerrit_sample目录下,打开git bash终端
  13. 在打开的git bash终端里,将已经commit的文件,执行下面命令进行review: git review
  14. 第一次git review时,提示输入用户名,请输入,而后等待提交完成
  15. 成功后,能够在review.xxxxxx.com上看到review记录

问题: 在window系统上初次执行git review 报错,git 找不到gerrit远程仓库,须要执行 git remote add gerrit ssh://username@review.xxxxxx.com:29418/gerrit_sample.gitpython

错误信息: Could not connect to gerrit. Enter your gerrit username: Trying again with ssh://@review.xxxx.com:29418/gerrit_sample.git <traceback object at 0x0000000003128A48> We don't know where your gerrit is. Please manually create a remote named "gerrit" and try again. Could not connect to gerrit at ssh://@review.xxxxx.com:29418/gerrit_sample.git Traceback (most recent call last): File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "c:\python27\lib\runpy.py", line 72, in run_code exec code in run_globals File "C:\Python27\Scripts\git-review.exe_main.py", line 9, in <module> File "c:\python27\lib\site-packages\git_review\cmd.py", line 1534, in main sys.exit(e.EXIT_CODE) AttributeError: 'GitReviewException' object has no attribute 'EXIT_CODE'git

相关文章
相关标签/搜索