git linux 终端上的“错误配置选项”,在 bitbucket ssh 连接期间。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17944112/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"Bad configuration option" on linux terminal, during bitbucket ssh connection.
提问by erbal
I would like to start to use bitbucket, I've made the tutorial's steps to connect to their server. link
我想开始使用 bitbucket,我已经按照教程的步骤连接到他们的服务器。关联
Bit something always wrong with the config file. I use ubuntu 12.10.
配置文件总是有点问题。我使用 ubuntu 12.10。
root@peter-VPCEH1M1E:/home/peter/Dropbox/C++/Qt/sql/.git# git push [email protected]:erbal/sql.git
/root/.ssh/config: line 1: Bad configuration option: [core]
/root/.ssh/config: line 2: Bad configuration option: repositoryformatversion
/root/.ssh/config: line 3: Bad configuration option: filemode
/root/.ssh/config: line 4: Bad configuration option: bare
/root/.ssh/config: line 5: Bad configuration option: logallrefupdates
/root/.ssh/config: line 6: Bad configuration option: ignorecase
/root/.ssh/config: line 7: Bad configuration option: [remote
/root/.ssh/config: line 8: Bad configuration option: fetch
/root/.ssh/config: line 9: Bad configuration option: url
/root/.ssh/config: line 10: Bad configuration option: [branch
/root/.ssh/config: line 11: Bad configuration option: remote
/root/.ssh/config: line 12: Bad configuration option: merge
/root/.ssh/config: terminating, 12 bad configuration optionsfatal: The remote end hung up unexpectedly
My config file looks like the example from the tutorial, with my ssh url.
我的配置文件看起来像教程中的示例,带有我的 ssh url。
回答by VonC
The configuration contentfile in question is not the ~/.ssh/config
one.
配置内容有问题的文件是不是 ~/.ssh/config
一个。
It is the git config(which somehow got copied over the ~/.ssh/config
) :
这是git 配置(不知何故被复制到了~/.ssh/config
):
- either the local one:
git config --local -l
(in your repo.git/config
) - or the global one:
git config --global -l
(in your homedir:~/.gitconfig
)
- 要么是本地的:(
git config --local -l
在您的回购中.git/config
) - 或全球性的:
git config --global -l
(在你的主目录:~/.gitconfig
)
(I will assume here that the system git config file is correct).
(我在这里假设系统 git 配置文件是正确的)。
You need to:
你需要:
- check the content of those files, looking for (for instance) incorrect eol (
\r\n
instead of\n
). - restore the
~/.ssh/config
with the content described in the bitbucket tutorial about multiple ssh keys.
- 检查这些文件的内容,寻找(例如)不正确的 eol(
\r\n
而不是\n
)。 ~/.ssh/config
使用有关多个 ssh 密钥的bitbucket 教程中描述的内容恢复。
An ~/.ssh/config
file should look like:
一个~/.ssh/config
文件应该是这样:
Host workdid
HostName bitbucket.org
IdentityFile ~/.ssh/workdid
Host personalid
HostName bitbucket.org
IdentityFile ~/.ssh/personalid
回答by iveqy
It looks like your ssh-config
file /root/.ssh/config
contains configuration for git which should be in /home/peter/Dropbox/C++/Qt/sql/.git/config
看起来您的ssh-config
文件/root/.ssh/config
包含 git 的配置,该配置应该在/home/peter/Dropbox/C++/Qt/sql/.git/config
ssh and git is two different programs. They interact with eachother but are configured seperately.
ssh 和 git 是两个不同的程序。它们相互交互,但单独配置。
It also looks like you're using dropbox to store your git-repo. This can cause problems, to cite the help at #git@freenode:
`
看起来您正在使用 dropbox 来存储您的 git-repo。这可能会导致问题,以引用#git@freenode:
`
12:19 <iveqy> !dropbox
12:19 -gitinfo([email protected])- Storing git repositories on DropBox is a Very Bad Idea?. Use a free hosting service (such as Bitbucket or GitHub), or read !dropbox_why if you insist upon having your repo corrupted.
12:19 <iveqy> !dropbox_why
12:19 -gitinfo([email protected])- git uses a lot of frequently-changed small files, which dropbox's synchronization algorithms barf on. Use of multiple dropbox clients compounds this, with hilarious results ` I suggest you read the link you posted again and try to follow the steps more carefully.
12:19 <iveqy> !dropbox
12:19 -gitinfo([email protected])- 在 DropBox 上存储 git 存储库是一个非常糟糕的主意吗?。使用免费的托管服务(例如 Bitbucket 或 GitHub),或者如果您坚持要损坏您的存储库,请阅读 !dropbox_why。
12:19 <iveqy> !dropbox_why
12:19 -gitinfo([email protected])- git 使用了很多经常更改的小文件,而 dropbox 的同步算法会拒绝这些文件。使用多个保管箱客户端会加剧这种情况,结果很有趣` 我建议您再次阅读您发布的链接,并尝试更仔细地按照步骤操作。