0

Below are errors for doing git clone

mondwan@dev:~/Documents/github$ git clone http://192.168.0.22/git/abc.git cba
Cloning into 'cba'...
error: Unable to find 50a8c651844665d4a3cde27219fcef5fe49e8aab under http://192.168.0.22/git/abc.git
Cannot obtain needed commit 50a8c651844665d4a3cde27219fcef5fe49e8aab
while processing commit 38ac6499b3b3c6ab153956a47d0d07575a88f969.
error: Fetch failed.

Above problems are due to fact that there are missing history in the repository.

Below are steps for how I setup abc.git repository

$> git clone --depth=1 https://github.com/angular/angular-seed.git abc
$> cd abc
$> echo "dummy" > dummy
$> git add . ; git commit -am 'dummy commit'
$> git remote add internal http://192.168.0.22/git/abc.git
$> git push internal master:master
Fetching remote heads...
  refs/
  refs/heads/
  refs/tags/
updating 'refs/heads/master'
  from 0000000000000000000000000000000000000000
  to   f56797c9db5a69a5b48073bab47db429e9f54134
    sending 38 objects
    done
Updating remote server info
To http://192.168.0.22/git/abc.git
 * [new branch]      master -> master
$> cd ..
$> git clone http://192.168.0.22/git/abc.git cba
Cloning into 'cba'...
error: Unable to find 6ca94d46e334b47e8e6066b2ea0ac79ffcee5c80 under http://192.168.0.22/git/abc.git
Cannot obtain needed commit 6ca94d46e334b47e8e6066b2ea0ac79ffcee5c80
while processing commit de30ee955c55ddf27b8fd15789ad18206bbbc285.
error: Fetch failed.

The only way I can fix is destroying the old history by calling rm -fr .git and setup a new one.

I am wondering are there any alternative to tackle this issue?

Mond Wan
  • 1,728
  • 2
  • 16
  • 20

1 Answers1

0
git pull
error: unable to find 2fcd18343b3817d1ed79a72c0c878811fd27e833

Was one of the first errors that ever happened to me.

In short, I can suggest to use:

git revert HEAD

(it's probably not the best, but it seems to work)

How do I pull from a Git repository through an HTTP proxy? gave me also some great insights on how to tackle it!

Community
  • 1
  • 1
Joey Dorrani
  • 371
  • 1
  • 1
  • Not the case. Since I cannot even clone a new copy for that repository, git revert does not work also – Mond Wan Jan 29 '15 at 14:54