且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

何时在存储库中创建一个新的头?

更新时间:2023-11-30 13:42:22

可以通过三种方式创建新头像:

A new head can be created in three ways:

  • 需要在push命令上使用--force时,会在您要推送到的存储库上创建一个新的磁头.提示:不必使用--force(或等效的-f)时不要使用push
  • 当您提交到不是分支头的变更集时;因此,如果您承诺包含孩子的变更集.
  • 当您从存储库中提取资源时,该存储库将在本地已经有子代的变更集的顶部添加新变更集.
  • when you need to use --force on the push command, a new head is created on the repository you push to. Hint: Do never use --force (or its equivalent -f) with push when you do not have to
  • when you commit to a changeset which is not a branch head; thus if you commit to a changeset which has children.
  • when you pull from a repository which adds new changesets on top of a changeset where you locally have already children.

在您的情况下,第22步将为远程存储库引入一个新的头.步骤#20中的push --force不能帮助您看到它仅在#22中发生,因为您因此系统地使水银变暗,表明正在创建一个新的打印头.

In your case step #22 would introduce a new head to the remote repository. The push --force in step #20 is not helping you to see that it only happens in #22 as you thus systematically mute mercurials hints that a new head is being created.

合并不同的头(或重新设置基准,但除非在某些情况下(例如未发布存储库和阶段< public),否则不会传播)会减少头的数量.

The number of heads are reduced when you merge different heads (or rebase - but that does not propagate except under certain conditions like non-publishing repository and phase < public).