Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error getting local git to new github repository

Tags:

git

github

-- EDIT -- I ended up copying all files to another folder an pushed from there. Without the commit history. :(

Thanks for responding tho.

-- /EDIT --

I'm new to git. For my html5 app I used aptana's html5 boilerplate which installs a git repository for you. Nice. Now, after working on my app for a few weeks, I want to push it to github. I created a new repository there.

Now when I try to push to github from shell or tortoisegit I run into errors after all files are uploaded:

$ git push -u origin master
...
remote: error: unable to find b4587434...<snip>...c701 (probably a checksum)
remote: fatal: objet of unexpected type
error: unpack failed: index-pack abnormal exit 
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://github.com/<user>/<project>.git'

I have been looking all around for a solution, but haven't been able to find something yet. Some actions I tried that didn't help:

  • I have renamed origin to something else.
  • I've created another repository on github.
  • "git status" confirms that I have nothing to commit.

Please help, It's really frustrating that git costs so much time to figure out for something that should be simple. :(

like image 592
winkbrace Avatar asked Nov 04 '22 01:11

winkbrace


1 Answers

I was trying to mirror Twbs bootstrap, but got an error like this and my problem was that I cloned the repo with --depth=1. I re-cloned the repo without the --depth= argument and everything worked perfectly using these steps:

  1. git clone --bare https://github.com/twbs/bootstrap.git
  2. cd bootstrap.git
  3. git push --mirror [email protected]:yourusername/your-repo-name.git
  4. cd ../ && rm -rf bootstrap.git
  5. git clone [email protected]:yourusername/your-repo-name.git
  6. cd your-repo-name
  7. git remote add twbs https://github.com/twbs/bootstrap.git

Now you can push to your own version of the repo with git push origin master and if you'd like to pull changes from the original repo you can simple do git pull twbs master.

More info available @ https://help.github.com/articles/duplicating-a-repository/

like image 126
buren Avatar answered Nov 09 '22 08:11

buren