2013-05-06 22 views
1

我有一個heroku應用程序。我克隆它開始工作。有一些問題,我不小心刪除了本地的.git目錄,並使用git init初始化了一個新目錄。heroku清理git日誌並重新開始

之後,我做了幾個提交,並添加了幾個功能,我的代碼。現在我想將代碼推送到heroku dyno。

所以我做git remote add origin git-remote-url。 嘗試git push,但得到的錯誤,做一個git pull提供了以下錯誤 -

warning: packfile .git/objects/pack/pack-887ccc7bf1196e49089e449ae1edd93c87c785b8.pack cannot be accessed 
fatal: bad object 00eb66f14b52f3808720aaa35285a4f32e019a05 
error: heroku.com:******.git did not send all necessary objects 

我該怎麼辦?

回答

0

也許這與您目前回購的狀態(您再次登錄的git init)相關聯,其中不包含已發佈的完整歷史記錄。
您需要再次克隆您的heroku reop,才能應用您在本地(但不完整)回購中進行的新提交;

喜歡的東西:

git clone --bare yourHerokuRepo 
cd /path/to/myapp          # where you deleted the `.git`) 
git remote add localHeroku /path/to/yourHerokuRepo.git 
git branch -m master oldmaster       # where your new commits are 
git fetch localHeroku         # get the full history 
git checkout -b master localHeroku/master    # now working on the branch with 
                 # a full history 
git cherry-pick ..oldmaster        # re-apply all your commits 
git push