【问题标题】:heroku clearing git logs and start afreshheroku 清除 git 日志并重新开始
【发布时间】:2013-04-29 23:26:09
【问题描述】:

我有一个 heroku 应用程序。我克隆了它并开始研究它。有一些问题,我不小心在本地删除了 .git 目录并使用 git init 初始化了一个新目录。

之后,我做了几次提交,并在我的代码中添加了一些功能。现在我想将代码推送到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

我该怎么办?

【问题讨论】:

    标签: git heroku heroku-toolbelt


    【解决方案1】:

    也许这与您当前回购的状态有关(您再次git init 的那个),其中不包含已发布的完整历史记录。
    您需要再次克隆您的 heroku reop,以便应用您在本地(但不完整)repo 中所做的新提交;

    类似:

    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
    

    【讨论】:

      猜你喜欢
      • 2011-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-02
      相关资源
      最近更新 更多