将Github代码推送到Bitbucket的问题

时间:2013-07-28 06:39:45

标签: github bitbucket

当我尝试将现有存储库从github推送到bitbucket时,我明白了: -

# git push
Counting objects: 1025, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (661/661), done.
Writing objects: 100% (1025/1025), 2.02 MiB, done.
Total 1025 (delta 302), reused 909 (delta 227)
error: Could not read d97e763d22304ebfa5a1fb7ba9468cb36d4eff49
fatal: Failed to traverse parents of commit 57211de122c9b449c2b4bb0d37ac6a73545a9c68
error: Could not read d97e763d22304ebfa5a1fb7ba9468cb36d4eff49
fatal: Failed to traverse parents of commit 57211de122c9b449c2b4bb0d37ac6a73545a9c68
To ssh://git@bitbucket.org/techvineet/task-manager.git
 ! [remote rejected] master -> master (missing necessary objects)
error: failed to push some refs to 'ssh://git@bitbucket.org/techvineet/test-site.git'

我做错了什么?

1 个答案:

答案 0 :(得分:1)

您可以执行以下操作:

  • 转到与此C:\xampp\htdocs\<project>\.git类似的本地GIT存储库,其中.git是隐藏文件夹。
  • 打开那里可用的config文件,它必须包含与此类似的代码

    [core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly``
    [remote "origin"]
        url = ssh://git@bitbucket.org/techvineet/test-site.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
        remote = origin
        merge = refs/heads/master

  • ssh://git@bitbucket.org/techvineet/test-site.git替换为https://<your_username>@bitbucket.org/techvineet/test-site.git
  • 在这里,您还可以永久保存您的密码,这可以通过在冒号后附加密码来保存您使用GIT的时间,https://techvineet:techvineet123@bitbucket.org/techvineet/test-site.git techvineet 应该是您的用户名 techvineet123 应该是相同的密码。
  • 保存文件并关闭当前的GIT会话。
  • 打开一个新会话并再次检查git status如果剩下任何未跟踪的文件添加使用git add *添加然后使用git commit -a -m 'Your Message'提交您的文件,请记住在拉动之前永远不要推送东西。在那里,您可以使用git pull,然后使用git push
  • 应该这样做。请检查并告知我们。

干杯!

相关问题