我正在使用 Maven 在 Github 上发布一个项目。release:prepare
失败:
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] remote: Permission to FOO/BAR.git denied to BAZ.
[ERROR] fatal: unable to access 'https://github.com/FOO/BAR.git/': The requested URL returned error: 403
奇怪的是,这BAZ
是“错误”的github.com
帐户。它是我在 Github 上使用的两个用户名之一,但不是我在BAR
项目中使用过的一个。假设正确的帐户是FIZZ
.
SCM 设置不指定用户名:
<scm>
<connection>scm:git:https://github.com/FOO/BAR.git</connection>
<url>scm:git:https://github.com/FOO/BAR.git</url>
<developerConnection>scm:git:https://github.com/FOO/BAR.git</developerConnection>
...
</scm>
(FOO
是我参与的一个组织。)事实上,我不知道究竟BAZ
是从哪里来的。它不在~/.gitconfig
or中.git/config
。没有~/.m2/settings.xml
文件。我的 Mavensettings.xml
文件没有提到 Github。
如果我git
在命令行上使用它可以工作——push
例如很好。
谁能告诉我这可能来自哪里?某个隐藏的配置文件或目录,无论是 Maven 还是 Git 相关的?
或者,记录 Github 用户以在私有本地文件中使用的最佳做法是什么,比如 Mavensettings.xml
或.git/config
,这样我就不需要将自己的用户放入构建文件中?
我正在使用 Mac OS X。