2

When I am trying to push my existing repository from github to bitbucket, I get this:-

# 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'

What I m doing wrong?

techvineet
  • 5,041
  • 2
  • 30
  • 28
  • While using GIT the first thing you should do is to check your local repository status, try to do `git status` and let us know whats happening there! – Rishi Kulshreshtha Jul 28 '13 at 06:43
  • Seems to be a similar problem as this post: http://stackoverflow.com/questions/13301748/why-is-my-git-push-to-hostgator-shared-hosting-failing – flamecto Jul 28 '13 at 06:44
  • @Rishi # On branch master # Untracked files: # (use "git add ..." to include in what will be committed) # # .project nothing added to commit but untracked files present (use "git add" to track) – techvineet Jul 28 '13 at 06:46

1 Answers1

1

You can do the following things:

  • Go to your local GIT repository similar to this C:\xampp\htdocs\<project>\.git where .git is a hidden folder.
  • Open the config file available there, it must contains the code similar to this

    [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

  • Replace the ssh://git@bitbucket.org/techvineet/test-site.git with https://<your_username>@bitbucket.org/techvineet/test-site.git
  • Here you can also permanently save your password, which can save your time while using GIT by appending your password after a colon, https://techvineet:techvineet123@bitbucket.org/techvineet/test-site.git where techvineet should be your username and techvineet123 should be the password for the same.
  • Save the file and close your current GIT session.
  • Open a new session and check one again git status if any untracked files are remaining to add use git add * to add then use git commit -a -m 'Your Message' to commit your files, remember never push before pulling the stuffs. There you can use git pull and then use git push
  • This should be done. Please check and let me know.

Cheers!

Rishi Kulshreshtha
  • 1,748
  • 1
  • 24
  • 35