使用 Mercurial 轻松判断您的工作目录位于哪个分支?
如果我使用 hg: 创建一个新分支,
$ hg branch newbranch
然后查看分支:
$ hg branches
default 194:d9df55198e53
newbranch 193:a36a491b8507 (inactive)
newbranch 被标记为(非活动),尽管我的工作当前直接映射到它。
如果我进行提交,默认值将被标记(非活动)。
但是,如果我切换到默认、合并和提交,然后切换回 newbranch,newbranch 会再次显示(非活动)。
这有点痛苦,因为我可能会在周五晚上这样做,直到周一才回来,并且不知道我的工作目录实际上指向哪个分支。
那么,有没有更好的方法来判断,或者我应该始终将其作为我的工作流程来在开始之前指定我想要工作的分支。
If I create a new branch using hg:
$ hg branch newbranch
And then look at branches:
$ hg branches
default 194:d9df55198e53
newbranch 193:a36a491b8507 (inactive)
newbranch is marked as (inactive), despite my working directly being currently mapped to it.
If I do a commit, default will then be flagged (inactive).
However, if I switch to default, merge, and commit, then switch back to newbranch, newbranch will say (inactive) again.
This is a bit of a pain, because I may do that on a friday night, and not come back to it until Monday, and not know what branch my working directory is actually pointed at.
So, is there a better way to tell, or should I always make it my workflow to specify the branch I want to work in before I start.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然
hg Summary
会告诉您所在的分支,但不带分支名称参数的hgbranch
也会告诉您。假设我以前从未创建过名为mybranch
的分支,但我想启动它:现在我已经工作了一段时间并想要提交,但忘记了是否设置了分支名称是否进行下一次提交:
哦,我做到了。
Though
hg summary
will tell you what branch you're on, so willhg branch
without a branch name argument. Let's say I've never created a branch calledmybranch
before, but I want to start it:And now I've worked for a bit and want to commit, but forgot if I set the branch name for this next commit or not:
Oh, I did.
好吧,我刚刚发现了 hg sum:
所以我猜你就是这样做的?
Ok, I just discovered hg sum:
So I guess this is how you do it?