gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 13:40:24 26 4
gpt4 key购买 nike

今天我开始为 做贡献 Wikimedia Gerrit community 在我的 Windows 10 (PC) 上使用 GitGitHub 桌面


首先我用 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 文件以消除警告。

关于python - 不推荐使用全局/系统 git-review 配置文件 (git-review.conf),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32503450/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com