Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 致命:refspec的远程部分不是:capabilities^{}中的有效名称_Git_Github_Bitbucket - Fatal编程技术网

Git 致命:refspec的远程部分不是:capabilities^{}中的有效名称

Git 致命:refspec的远程部分不是:capabilities^{}中的有效名称,git,github,bitbucket,Git,Github,Bitbucket,从github克隆给定的回购,然后在bitbucket上推送到一个新的回购,我得到了错误: > fatal: remote part of refspec is not a valid name in :capabilities^{} > fatal: The remote end hung up unexpectedly 这个错误意味着什么?是什么导致了它(我对git还是新手) 这是日志: - clone from github: $ git clone git://github

从github克隆给定的回购,然后在bitbucket上推送到一个新的回购,我得到了错误:

> fatal: remote part of refspec is not a valid name in :capabilities^{}
> fatal: The remote end hung up unexpectedly
这个错误意味着什么?是什么导致了它(我对git还是新手)

这是日志:

- clone from github:
$ git clone git://github.com/ASKBOT/askbot-devel.git  test2
$ cd test2

- create a private git repo on bitbucket:
on the site GUI

- add remote:
$ git remote add bbtest2 https://shishani@bitbucket.org/shishani/test2.git

$ git remote -v
bbtest2 https://shishani@bitbucket.org/shishani/test2.git (fetch)
bbtest2 https://shishani@bitbucket.org/shishani/test2.git (push)
origin  git://github.com/ASKBOT/askbot-devel.git (fetch)
origin  git://github.com/ASKBOT/askbot-devel.git (push)

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/admin-interface
  remotes/origin/adminarea
  remotes/origin/adolfo-postman
  remotes/origin/allow-other-login-apps
  remotes/origin/anon-posting
  remotes/origin/askbot-site
  remotes/origin/auto-media-revisions
  remotes/origin/avatars-sidebar
  remotes/origin/beta2-english-chinese
  remotes/origin/better-setup
  remotes/origin/blockip
  remotes/origin/bug102
  remotes/origin/bugfixes
  remotes/origin/cache-experiment
  remotes/origin/categories
  remotes/origin/cnprog-import
  remotes/origin/common-question-view
  remotes/origin/development
  remotes/origin/django-registration
  remotes/origin/elastic-skin
  remotes/origin/experimental
  remotes/origin/experimental-merge
  remotes/origin/fabian
  remotes/origin/fbconnect
  remotes/origin/feature73
  remotes/origin/follow-user
  remotes/origin/gh-pages
  remotes/origin/inbox-and-flagged-items
  remotes/origin/issue116
  remotes/origin/jinja
  remotes/origin/master
  remotes/origin/multi-auth-app
  remotes/origin/new-template
  remotes/origin/newauth
  remotes/origin/password-only
  remotes/origin/postgres-full-text
  remotes/origin/pt-i18n
  remotes/origin/refs/heads/skins
  remotes/origin/remove-django-authopenid
  remotes/origin/remove-recaptcha-module
  remotes/origin/signin-config
  remotes/origin/sophia
  remotes/origin/sphinx-search
  remotes/origin/stackexchange
  remotes/origin/staticfiles
  remotes/origin/vlad111
  remotes/origin/wikipost

- push mirror to remote

$ git push --mirror  bbtest2
Password: 
fatal: remote part of refspec is not a valid name in :capabilities^{}
fatal: The remote end hung up unexpectedly


- ordinary push - just for testing:

$ git push bbtest2
Password: 
Everything up-to-date
编辑-进一步的测试日志:首先推送主机:

$ git push bbtest2 master
Password: 
Counting objects: 24187, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6694/6694), done.
Writing objects: 100% (24187/24187), 11.88 MiB | 86 KiB/s, done.
Total 24187 (delta 17229), reused 23691 (delta 16845)
remote: bb/acl: shishani is allowed. accepted payload.
To https://shishani@bitbucket.org/shishani/test2.git
 * [new branch]      master -> master

$ git push --all bbtest2
Password: 
Everything up-to-date

$ git push --mirror bbtest2
Password: 
Counting objects: 4822, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1540/1540), done.
Writing objects: 100% (4246/4246), 3.83 MiB | 86 KiB/s, done.
Total 4246 (delta 2891), reused 3860 (delta 2609)
remote: bb/acl: shishani is allowed. accepted payload.
To https://shishani@bitbucket.org/shishani/test2.git
 * [new branch]      bbtest2/master -> bbtest2/master
 * [new branch]      origin/HEAD -> origin/HEAD
 * [new branch]      origin/admin-interface -> origin/admin-interface
 * [new branch]      origin/adminarea -> origin/adminarea
 * [new branch]      origin/adolfo-postman -> origin/adolfo-postman
 * [new branch]      origin/allow-other-login-apps -> origin/allow-other-login-apps
 * [new branch]      origin/anon-posting -> origin/anon-posting
 * [new branch]      origin/askbot-site -> origin/askbot-site
 * [new branch]      origin/auto-media-revisions -> origin/auto-media-revisions
 * [new branch]      origin/avatars-sidebar -> origin/avatars-sidebar
 * [new branch]      origin/beta2-english-chinese -> origin/beta2-english-chinese
 * [new branch]      origin/better-setup -> origin/better-setup
 * [new branch]      origin/blockip -> origin/blockip
 * [new branch]      origin/bug102 -> origin/bug102
 * [new branch]      origin/bugfixes -> origin/bugfixes
 * [new branch]      origin/cache-experiment -> origin/cache-experiment
 * [new branch]      origin/categories -> origin/categories
 * [new branch]      origin/cnprog-import -> origin/cnprog-import
 * [new branch]      origin/common-question-view -> origin/common-question-view
 * [new branch]      origin/development -> origin/development
 * [new branch]      origin/django-registration -> origin/django-registration
 * [new branch]      origin/elastic-skin -> origin/elastic-skin
 * [new branch]      origin/experimental -> origin/experimental
 * [new branch]      origin/experimental-merge -> origin/experimental-merge
 * [new branch]      origin/fabian -> origin/fabian
 * [new branch]      origin/fbconnect -> origin/fbconnect
 * [new branch]      origin/feature73 -> origin/feature73
 * [new branch]      origin/follow-user -> origin/follow-user
 * [new branch]      origin/gh-pages -> origin/gh-pages
 * [new branch]      origin/inbox-and-flagged-items -> origin/inbox-and-flagged-items
 * [new branch]      origin/issue116 -> origin/issue116
 * [new branch]      origin/jinja -> origin/jinja
 * [new branch]      origin/master -> origin/master
 * [new branch]      origin/multi-auth-app -> origin/multi-auth-app
 * [new branch]      origin/new-template -> origin/new-template
 * [new branch]      origin/newauth -> origin/newauth
 * [new branch]      origin/password-only -> origin/password-only
 * [new branch]      origin/postgres-full-text -> origin/postgres-full-text
 * [new branch]      origin/pt-i18n -> origin/pt-i18n
 * [new branch]      origin/refs/heads/skins -> origin/refs/heads/skins
 * [new branch]      origin/remove-django-authopenid -> origin/remove-django-authopenid
 * [new branch]      origin/remove-recaptcha-module -> origin/remove-recaptcha-module
 * [new branch]      origin/signin-config -> origin/signin-config
 * [new branch]      origin/sophia -> origin/sophia
 * [new branch]      origin/sphinx-search -> origin/sphinx-search
 * [new branch]      origin/stackexchange -> origin/stackexchange
 * [new branch]      origin/staticfiles -> origin/staticfiles
 * [new branch]      origin/vlad111 -> origin/vlad111
 * [new branch]      origin/wikipost -> origin/wikipost
 * [new tag]         0.7.25 -> 0.7.25
 * [new tag]         0.7.26 -> 0.7.26
 * [new tag]         0.7.27 -> 0.7.27
 * [new tag]         0.7.28 -> 0.7.28
 * [new tag]         0.7.29 -> 0.7.29
 * [new tag]         0.7.30 -> 0.7.30
 * [new tag]         0.7.31 -> 0.7.31
 * [new tag]         0.7.32 -> 0.7.32
 * [new tag]         0.7.33 -> 0.7.33
 * [new tag]         0.7.34 -> 0.7.34
 * [new tag]         0.7.35 -> 0.7.35
 * [new tag]         0.7.36 -> 0.7.36
 * [new tag]         0.7.37 -> 0.7.37
 * [new tag]         0.7.38 -> 0.7.38
 * [new tag]         history+wikipost -> history+wikipost
 * [new tag]         remove -> remove
 * [new tag]         show -> show

$

我将首先推动主分支,以初始化空的BitBucket回购历史记录。
然后我会推动其他一切

git push bbtest2 master
git push --mirror bbtest2

“.”中列出了使用https(SSL)需要设置的所有参数。

尝试使用SSH而不是HTTP进行推送

git push --mirror git@github.com:shishani/test2.git

您是否可以先尝试
git-push-bbtest2 master
,然后尝试
git-push-all-bbtest2
?您是否也先在bitbucket repo上测试https操作(如简单的克隆),并将所有参数设置为https使用?正如在感谢中一样-我根据您的第一条评论添加了一个日志,现在正在处理您的第二条评论:)您似乎已经为SSL正确设置了所有内容,因为您的推送成功了。我在下面的回答中添加了相关的命令。我已经使用SSL URL有一段时间了-到目前为止还没有发现任何问题。我也一直在使用Bitbucket,没有任何问题。这对我很有帮助。(被接受的回答对我没有帮助)。