“Bad configuration option” on linux terminal, duri

2019-05-27 01:38发布

I would like to start to use bitbucket, I've made the tutorial's steps to connect to their server. link

Bit something always wrong with the config file. I use ubuntu 12.10.

root@peter-VPCEH1M1E:/home/peter/Dropbox/C++/Qt/sql/.git# git push git@bitbucket.org: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.

标签: git bitbucket
2条回答
啃猪蹄的小仙女
2楼-- · 2019-05-27 02:21

The configuration content file in question is not the ~/.ssh/config one.

It is the git config (which somehow got copied over the ~/.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)

(I will assume here that the system git config file is correct).

You need to:

An ~/.ssh/config file should look like:

Host workdid
 HostName bitbucket.org
 IdentityFile ~/.ssh/workdid
Host personalid
 HostName bitbucket.org
 IdentityFile ~/.ssh/personalid
查看更多
爷的心禁止访问
3楼-- · 2019-05-27 02:44

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 and git is two different programs. They interact with eachother but are configured seperately.

It also looks like you're using dropbox to store your git-repo. This can cause problems, to cite the help at #git@freenode: `

12:19 <iveqy> !dropbox
12:19 -gitinfo(jast@infobot.gitrecipes.de)- 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(jast@infobot.gitrecipes.de)- 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.

查看更多
登录 后发表回答