简体   繁体   中英

How to reverse the ENTIRE commit history in git?

My commit history currently looks like, let's say, ABCDEF with F being the HEAD. For some weird reason, I want it to be like FEDCBA with A as HEAD. I can't let others just checkout branch A because I want them to see the entire change history from A back to F . Is there any way I could entirely reverse the commit history in git?

Updated: (Requirement: Okay, so, there's this huge codebase that's not on git. All we have is vague documentation about changes made (in text files). We want to put that in git, for future users and ease of maintenance. However, we did not have a proper original version. However, we did have the files like how they look now and the rough change docs. So, we took the current version, reverse applied the forward-changes to make it look like versioned-back. That way, we do have the original version now, but it's HEAD. We want the HEAD to be the last (which was the one we started out with) and also need this history. )

这对我来说绝对没有意义...但是您可以使用git rebase -i A^ ,然后在您可以编辑的文本文件中对提交进行排序。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM