如何在提交时创建新的头?

发布于 2024-12-01 17:15:48 字数 975 浏览 1 评论 0原文

我正在写我的论文并将更改存储在 Mercurial 中。我没有收到“我有多个头”的错误,对此我感到很困惑——我只有一个工作存储库,我偶尔会将其推送到 bitbucket。发生的事情是这样的:

$ hg commit -m "Fixing up..."
abort: No such file or directory: /Users/me/Dropbox/thesis/thesis_tex/simple.pdf
$ hg commit -m "Adding in page headers"
created new head

...再次提交,没有意识到创建一个新头是一个问题...

$ hg push
pushing to ssh://[email protected]/...
searching for changes
abort: push creates new remote heads!
(did you forget to merge? use push -f to force)

$ hg heads
changeset:   26:3823a395b1ce
tag:         tip
user:        me
date:        Fri Aug 26 09:39:45 2011 -0400
summary:     Adding...

changeset:   24:c7c6517d4281
user:        me
date:        Thu Aug 25 16:34:42 2011 -0400
summary:     Fixing up...

我怎样才能轻松地摆脱另一个头,而不弄乱我的工作目录?为什么要创造第二个头?将 Mercurial 存储库保存在 dropbox 文件夹中是否存在问题?

I'm working on my thesis and storing changes in mercurial. I'm not getting an error that I've got multiple heads, which I'm confused about -- I've only got one working repository which I push occasionally to bitbucket. Here's what happened:

$ hg commit -m "Fixing up..."
abort: No such file or directory: /Users/me/Dropbox/thesis/thesis_tex/simple.pdf
$ hg commit -m "Adding in page headers"
created new head

...one more commit, not having realized that having created a new head was a problem...

$ hg push
pushing to ssh://[email protected]/...
searching for changes
abort: push creates new remote heads!
(did you forget to merge? use push -f to force)

$ hg heads
changeset:   26:3823a395b1ce
tag:         tip
user:        me
date:        Fri Aug 26 09:39:45 2011 -0400
summary:     Adding...

changeset:   24:c7c6517d4281
user:        me
date:        Thu Aug 25 16:34:42 2011 -0400
summary:     Fixing up...

How can I easily get rid of the other head, without messing up my working directory? Why did a second head get created? Is there a problem with keeping mercurial repositories in dropbox folders?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

撩人痒 2024-12-08 17:15:48

如何轻松摆脱另一个头,而不弄乱我的工作目录?

使用 hg merge 合并分支。

将 Mercurial 存储库保存在 Dropbox 文件夹中是否存在问题?

这对我来说似乎多余,因为 Dropbox 会保留您的文件 30 天的历史记录。我会选择 Hg+Bitbucket(或任何 Mercurial 托管)或 Dropbox,但不能同时选择两者。


编辑:为什么不使用 Mercurial Dropbox? 原因如下。

Ben Hughes 说得好

通过将 Mercurial 存储库保留在 Dropbox 上,您可以对版本控制系统文件进行版本控制。如果您以某种方式设法与 .hg 目录中的文件发生冲突,事情可能会变得混乱。可恢复,但很混乱。

How can I easily get rid of the other head, without messing up my working directory?

Merge the branches with hg merge.

Is there a problem with keeping mercurial repositories in dropbox folders?

This seems redundant to me, since Dropbox keeps a 30-day history on your files. I'd choose either Hg+Bitbucket (or whatever Mercurial hosting) or Dropbox, but not both.


Edit: Why not use Mercurial and Dropbox? Here's why.

Ben Hughes said it well:

By keeping your Mercurial repo on Dropbox you’re version controlling your version control system files. If you somehow manage to cause a conflict with files in your .hg directory, things could get messy. Recoverable, but messy.

GRAY°灰色天空 2024-12-08 17:15:48

我不同意@Matt Ball 关于保管箱问题的观点。

我认为冗余是你的朋友。此外,Hg 和保管箱的用途在您的情况下也略有不同。

Dropbox 会自动为您备份(还可以跟踪文件更改,让您在任何有互联网的计算机上工作,并轻松共享您的工作。),Hg 可以让您离线工作并按逻辑块提交(以及作为备份)当您同步时)。

我在我的保管箱文件夹中使用 Hg 至少有一年了,没有出现任何问题,而且没有遇到任何问题。

如果您在多台计算机上工作并且所有计算机上都有 dropbox/Hg 组合,我建议您让 dropbox 进行同步。

I disagree with @Matt Ball on the dropbox matter.

I think redundancy is your friend. Also the purpose of Hg and the dropbox is slightly different in your case.

Dropbox backs up for you automatically (as well as tracking file changes and letting you work on any machine with internet and making it easy to share your work.) and Hg lets you work offline and commit in logical chunks (as well as working as backup when you sync).

I have used Hg in my dropbox folder without problem for at least a year and I have not experienced any problems.

If you work on more than one machine and have the dropbox/Hg combo on all machines I suggest that you let dropbox do the syncing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文