"Force" 和 Tortoise Git 中的 "Override branch if exists" 之间的区别
Difference between "Force" and "Override branch if exists" in Tortoise Git
我在一个小团队中使用 git 并使用 TortoiseGit 作为客户端。每天我都会发现我的本地分支机构在分支机构后面进行了一些提交,没有任何本地更改。
我的做法是从远程更新开始,然后是 Switch/checkout 到 <remote branch>
。如果我已经有相应的本地分支机构,我需要选中 Force
或 Override branch if exists
复选框才能继续。
问题:两者有什么区别?
进一步阅读:我知道还有其他可能性,例如 Pull
或 Reset branch to this
。由于各种原因,上述过程恰好是我最喜欢的。
强制: 它将用存储库版本覆盖工作树。
如果存在则覆盖分支:如果您正在创建的分支存在,这将覆盖您在该分支的本地分支中所做的更改。
希望对您有所帮助。
参见TortoiseGit manual (or Git man page):
Force
When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.
When checking out paths from the index, do not fail upon unmerged entries; instead, unmerged entries are ignored.
我在一个小团队中使用 git 并使用 TortoiseGit 作为客户端。每天我都会发现我的本地分支机构在分支机构后面进行了一些提交,没有任何本地更改。
我的做法是从远程更新开始,然后是 Switch/checkout 到 <remote branch>
。如果我已经有相应的本地分支机构,我需要选中 Force
或 Override branch if exists
复选框才能继续。
问题:两者有什么区别?
进一步阅读:我知道还有其他可能性,例如 Pull
或 Reset branch to this
。由于各种原因,上述过程恰好是我最喜欢的。
强制: 它将用存储库版本覆盖工作树。
如果存在则覆盖分支:如果您正在创建的分支存在,这将覆盖您在该分支的本地分支中所做的更改。
希望对您有所帮助。
参见TortoiseGit manual (or Git man page):
Force
When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.
When checking out paths from the index, do not fail upon unmerged entries; instead, unmerged entries are ignored.