简体   繁体   English

不推荐使用全局/系统git-review配置文件(git-review.conf)

[英]Using global/system git-review config files (git-review.conf) is deprecated

Today I started to contribute for the Wikimedia Gerrit community with Git and GitHub Desktop on my Windows 10 (PC). 今天,我开始在Windows 10 (PC)上使用GitGitHub DesktopWikimedia Gerrit社区做出贡献。


First I installed the git-review package with Pip: 首先我用Pip安装了git-review软件包:

$ pip install git-review

After I loged in, I cloning and creating a new branch with Git: 在我进入后,我克隆并用Git创建一个新的分支:

$ ssh suriyaa@gerrit.wikimedia.org -p 29418

$ git clone ssh://suriyaa@gerrit.wikimedia.org:29418/operations/mediawiki-config
$ git pull origin master
$ git checkout -b suriyaakudocommits origin/master
$ git branch
$ git branch suriyaakudocommits --track origin/master
$ git checkout suriyaakudocommits

I editing a file and add it with git add : 我编辑一个文件并用git add添加它:

$ git diff
$ git status
$ git add 404.html
$ git status
$ git diff --cached
$ git commit
$ git pull --rebase origin master

I used git review -R to commit my changes from my branch " suriyaakudocommits " to Wikimedia Gerrit (branch: " master ") and I got this (error) output: 我使用git review -R将我的更改从我的分支“ suriyaakudocommits ”提交到Wikimedia Gerrit(分支:“ master ”),我得到了这个(错误)输出:

C:\Users\Suriyaa\Documents\GitHub\mediawiki-config [suriyaakudocommits]> git review -R
Using global/system git-review config files (C:\Users\Suriyaa/.config/git-review\git-review.conf) is deprecated
Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\git-review.exe\__main__.py", line 9, in <module>
  File "C:\Python34\lib\site-packages\git_review\cmd.py", line 1522, in main
    _main()
  File "C:\Python34\lib\site-packages\git_review\cmd.py", line 1393, in _main
    config = Config(os.path.join(top_dir, ".gitreview"))
  File "C:\Python34\lib\site-packages\git_review\cmd.py", line 285, in __init__
    self.config.update(load_config_file(filename))
  File "C:\Python34\lib\site-packages\git_review\cmd.py", line 671, in load_config_file
    configParser.read(config_file)
  File "C:\Python34\lib\configparser.py", line 672, in read
    self._read(fp, filename)
  File "C:\Python34\lib\configparser.py", line 1058, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'C:\\Users\\Suriyaa/.config/git-review\\git-review.conf', line: 1
'[gerrit]\n'

What's wrong? 怎么了? I hope someone can help me. 我希望有一个人可以帮助我。

I use Python 3.4 (32 bit) ! 我使用Python 3.4(32位)

I followed the MediaWiki tutorial for Gerrit . 我按照GerritMediaWiki教程进行了操作


The code of C:\\\\Users\\\\Suriyaa/.config/git-review\\\\git-review.conf file: C:\\\\Users\\\\Suriyaa/.config/git-review\\\\git-review.conf文件的代码:

[gerrit]
defaultremote = origin

The MediaWiki tutorial you mentioned now says that the git-review.conf file is deprecated. 您现在提到的MediaWiki教程说不推荐使用git-review.conf文件。 Instead, you should use: 相反,你应该使用:

$ git config --global gitreview.remote origin

I also had to remove the .conf file to get rid of the warning. 我还必须删除.conf文件以消除警告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM