部署重写的Github / Heroku应用程序 [英] Deploying a Re-Written Github/Heroku App

查看:96
本文介绍了部署重写的Github / Heroku应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序在Heroku / Github上运行,但最近完全从头开始重建 - 我想保留旧的存储库名称,用新代码替换实时代码的最佳方法是什么?

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 live code with the new code?

推荐答案

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.

这篇关于部署重写的Github / Heroku应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆