6

When pushing to Github I encounter the following error

Counting objects: 16780, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10936/10936), done.
remote: error: object f4ac3e31afb08298c6cd2ac04c6853940bbab3f6:contains '.git'
remote: fatal: Error in object
error: pack-objects died of signal 13
error: failed to push some refs to 'git@github.com:omarshammas/repo_name.git'

This git object f4ac3e31afb08298c6cd2ac04c6853940bbab3f6 complains that it contains the .git folder. I imagine this was caused when migrating over from mercurial to git.

Anyways, I tried removing the .git folder from the history using

git filter-branch --force --index-filter \
'git rm -r --cached --ignore-unmatch .git' \
--prune-empty --tag-name-filter cat -- --all

But I still encounter the error.

I haven't had a problem pushing to other remotes such as (bitbucket / heroku). Github apparently has more stringent validations in place.

Not sure if it matters, but the object that is complaining is a tree object.

> git show f4ac3e31afb08298c6cd2ac04c6853940bbab3f6

tree f4ac3e31afb08298c6cd2ac04c6853940bbab3f6

.git/
MIT-LICENSE
README.textile
assets/
init.rb
install.rb
lib/
tasks/

Thanks

omarshammas
  • 631
  • 4
  • 18
  • 5
    Check this stackoverflow answers: http://stackoverflow.com/questions/16821649/removing-git-directory-from-git-repo http://stackoverflow.com/questions/14728751/pushing-a-git-repo-fails-with-error-contains-git – pbaranski Apr 09 '14 at 05:53
  • @abrasadera the first link did the trick. thanks! If you add it as an answer I will accept it. – omarshammas Apr 12 '14 at 05:07
  • 1
    stack marked my answer as trivial so must stay as it is in comment - glad to help you :) – pbaranski Apr 12 '14 at 16:33

0 Answers0