简体   繁体   English

如何将新项目添加为提交而不是旧项目而不丢失历史记录?

[英]How to add a new project as a commit instead of an old one and not lose history?

I use Intellij to upload projects on Github, is it possible to upload a new project as an old commit?我使用 Intellij 在 Github 上上传项目,是否可以将新项目作为旧提交上传? Of course, I don't want to lose the history of the old project.当然,我不想丢失旧项目的历史。

Yes it is possible.对的,这是可能的。

All you have to do is delete all files of old project and copy paste the files of new project inside the project folder.您所要做的就是删除旧项目的所有文件并将新项目的文件复制粘贴到项目文件夹中。 I hope you don't have to change this project folder name.我希望您不必更改此项目文件夹名称。 But make sure you don't delete .git folder inside your project folder.但请确保不要删除项目文件夹中的.git文件夹。 It's a hidden folder.这是一个隐藏文件夹。 Rest all you can delete. Rest 所有你可以删除。

After that just commit this big change and a new project will be pushed over the old project in the repository as a commit.之后,只需提交这个重大更改,一个新项目将作为提交推送到存储库中的旧项目之上。

I hope you know how to commit.我希望你知道如何承诺。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果旧的存储库不在线,如何将所有提交历史记录保存在旧的存储库中,并将其内容移动到新的存储库中? - How to keep all commit history in an old repo and move its content into a new one if the old repository doesn't exist online? 当整个项目通过“首次提交”提交到全新的 repo 时,如何添加回原始项目历史记录 - How to add back the original project history when the whole project was committed with a “first commit” to a brand new repo 如何创建一个新的 Git 存储库而不是旧的存储库并保留提交历史? - How to create a new Git repo instead of an old one and keep the commits history? 如何将具有提交历史记录的一个分支复制到另一新仓库? - How to copy one branch with commit history to another new repo? 如何清理历史提交而不会丢失更改 - How to clean-up history commit with no lose changes 如何将所有提交历史压缩为一个提交? - how to compress all commit history into one commit? 如何检出旧提交并使其成为新提交 - How to checkout an old commit and make it a new commit 从旧提交进行新的回购,保持历史 - Make new repo from old commit keeping history up to then 阻止新分支获取Git中的旧提交历史记录 - Stop new branch from getting old commit history in Git git checkout旧提交作为新提交 - Git checkout old commit as new one
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM