Deploying a Re-Written Github/Heroku App

后端 未结 2 1333
忘了有多久
忘了有多久 2020-12-18 10:56

I have an app that is live on Heroku/Github, but recently completely rebuilt it from scratch - I want to keep the old repository name, what is the best way to replace the li

2条回答
  •  暖寄归人
    2020-12-18 11:01

    cd old_version
    git rm -rf .
    git commit -m "Removing the old code"
    git remote add version2 "/path/to/new_version/.git"
    git pull version2 master
    

    That should fully preserve both histories and have the new version be the HEAD of orginal repo. I would recommend backing up repos up before you try this.

提交回复
热议问题