Windows 版 Github 具有这两个命令,描述如下:
-
revert this commit
- 创建一个新的提交来恢复此提交的更改
-
rollback this commit
- 回滚此提交,将在此提交和以后提交中所做的所有更改保留在工作目录中
您能解释一下这两个命令的确切含义以及如何使用它们吗?具体来说,我无法理解第二个的目的是什么。对我来说完全是无稽之谈。
是否可以恢复到之前的提交,检查一下,如果我不喜欢它,则返回到最初的位置?
这个 gui 似乎只是 git 系统的一小部分,但是使用它的正确工作流程是什么?
假设您的存储库中有一个文件,并且有以下提交:
commit 1 : the file contains A
commit 2 : the file contains B
commit 3 : the file contains C
如果你执行revert oncommit 3
,您将在存储库中看到以下内容:
commit 1 : the file contains A
commit 2 : the file contains B
commit 3 : the file contains C
commit 4 : the file contains B
并且工作副本中的文件也将包含 B。
如果执行回滚,您将在存储库中看到以下内容:
commit 1 : the file contains A
commit 2 : the file contains B
并且工作副本中的文件将保持不变。因此,该文件将包含 C。例如,它允许您修复小错误并再次提交。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)