在git中编辑旧提交 [英] Editing Old Commit in git
问题描述
我想在Visual Studio C#中重新设计我的图形用户界面。我使用git bash来达到这个目的,因为我有我所有工作的提交日志。
我输入了下面的命令:
$ g $ reb $ -i HEAD〜3
$ / code >
然后我的记事本++编辑弹出,因为我配置了它。现在我在提交消息之前键入编辑,在那里git显示后我会重新设计表单我的两个命令
git commit --amend
git rebase --continue
我输入了 git commit --amend
,它再次打开了我的记事本++窗体,然后I打开我的视觉工作室窗体,然后重新设计了窗体,然后关闭了我的visual studio和notepad ++,然后键入 git rebase --continue
但它没有奏效。
所以我的问题是,在什么时间点我应该改变我的Visual Studio表单?
当重组暂停时,您应该进行更改。然后像通常为提交一样添加这些更改(使用 git add
)。但不是将它们作为新提交提交,而是使用 git commit --amend
修改前一个。这将改变你正在编辑的提交。
然后,使用 git rebase --continue
继续变形并应用稍后的提交。
I want to redesign my Graphical User Interface in Visual Studio C#.I am using git bash for this purposes since I have a commit log of all my work. I entered the following command
git rebase -i HEAD~3
Then my notepad++ edit popped up since I configured that.Now I type edit before the commit message where I would do my redesigning of form after that git showed me two commands
git commit --amend
git rebase --continue
I entered git commit --amend
and it again opened up my notepad++ form then I opened my visual studio form and redesigned the form after that I closd both my visual studio and notepad++ and typed git rebase --continue
but it did not worked.
So my question is that in what point of time I should make changing in my Visual Studio Form?
When the rebasing pauses, you should do your changes. Then you add those changes like you usually do for a commit (using git add
). But instead of committing them as a new commit, you amend the previous one using git commit --amend
. This will change the commit you are currently editing.
After that, use git rebase --continue
to continue rebasing and applying the later commits.
这篇关于在git中编辑旧提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!