如何从一开始就重新提交所有提交 [英] How to rebase all the commits from the beginning

查看:119
本文介绍了如何从一开始就重新提交所有提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我从svn(code.google.com)迁移到git(github)。

So I'm migrating from svn (code.google.com) to git(github).

我从svn repo导入了我的项目,并且它沿途导入了所有提交历史记录。
我对这些评论并不是很自豪,因为它是我第一个项目中的一个,不是很认真。

I've imported my project from the svn repo, and it imported all the commit history along way. I'm not really proud of those comments as it was one of my first project, not really serious.

我想将所有内容重新组合为一个单一的初始导入提交。

I'd like to rebase everything into a single 'initial import' commit.

我已经将所有内容都放在了我的电脑上,我试图这样做。但是我发现的只是:
git rebase -i master 但它只是重新设置了新的修改和提交。

I've pulled everything on my computer and I'm trying to do that. But all I found was: git rebase -i master but it only rebases new modifications and commits.

我如何从所有历史记录中清除我的github存储库?

How can I clean my github repository from all history with a rebase?

推荐答案

如果您想要(除了最初的提交),但为什么要麻烦?简单地删除.git目录,运行 git init 重新创建它, git add 所有内容, git commit 来做一个新的初始提交。

You could rebase and squash everything if you wanted to (except the initial commit) but why bother? Simply delete your .git directory, run git init to recreate it, git add everything, and git commit to make a new initial commit.

这篇关于如何从一开始就重新提交所有提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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