Error getting local git to new github repository

git, github

Solution

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:

- `git clone --bare https://github.com/twbs/bootstrap.git`

- `cd bootstrap.git`

- `git push --mirror git@github.com:yourusername/your-repo-name.git`

- `cd ../ && rm -rf bootstrap.git`

- `git clone git@github.com:yourusername/your-repo-name.git`

- `cd your-repo-name`

- `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/

Problem

-- 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. :(

Original source