使用 global/system git-审查配置文件 (git-review.conf) 已弃用
Using global/system git-review config files (git-review.conf) is deprecated
今天我开始为 Wikimedia Gerrit community 贡献 Git 和 GitHub Desktop 在我的 Windows 10 (PC) 上。
首先我用 Pip 安装了 git-review
包:
$ pip install git-review
登录后,我使用 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
我编辑了一个文件并添加了 git add
:
$ git diff
$ git status
$ git add 404.html
$ git status
$ git diff --cached
$ git commit
$ git pull --rebase origin master
我使用 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)!
I followed the MediaWiki tutorial for Gerrit.
C:\Users\Suriyaa/.config/git-review\git-review.conf
文件的代码:
[gerrit]
defaultremote = origin
您现在提到的 MediaWiki tutorial 表示 git-review.conf 文件已弃用。相反,您应该使用:
$ git config --global gitreview.remote origin
我还必须删除 .conf 文件才能消除警告。
今天我开始为 Wikimedia Gerrit community 贡献 Git 和 GitHub Desktop 在我的 Windows 10 (PC) 上。
首先我用 Pip 安装了 git-review
包:
$ pip install git-review
登录后,我使用 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
我编辑了一个文件并添加了 git add
:
$ git diff
$ git status
$ git add 404.html
$ git status
$ git diff --cached
$ git commit
$ git pull --rebase origin master
我使用 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)!
I followed the MediaWiki tutorial for Gerrit.
C:\Users\Suriyaa/.config/git-review\git-review.conf
文件的代码:
[gerrit]
defaultremote = origin
您现在提到的 MediaWiki tutorial 表示 git-review.conf 文件已弃用。相反,您应该使用:
$ git config --global gitreview.remote origin
我还必须删除 .conf 文件才能消除警告。