开发者

Keeping a single head at remote repo?

开发者 https://www.devze.com 2022-12-21 05:52 出处:网络
I\'m sure this has been answered before/somewhere, as i assume it\'s a common issue, i j开发者_如何学Goust can\'t find it.

I'm sure this has been answered before/somewhere, as i assume it's a common issue, i j开发者_如何学Goust can't find it.

Basically i have a head, of working code, and branches with various code paths. Like normal. Though when i push i do want all of these branches uploaded to the remote repo. I do so with push -f. Now the problem is my current working branch, i guess is considered the head because technically it is newer than what i consider the head branch.

With that said, for the remote repo, i would like the default branch viewed to be .. my.. head (ie, what i consider the head/main code path). Note i am using BitBucket, but i'm assuming this is an issue with Mercurial, not BitBucket.

Any thoughts?


Well, first I think that some vocabulary must be redefined in order to understand each properly:

  • in Hg, there is basically no distinction between the "main" branch and the others.
    The main branch is identifiable by it's name "default" assigned form the start by HG, but that's all
  • The latest changeset that is placed in a repository, from a commit, a pull or a push, is called the tip. It is one of the branch head, nothing more.

So, what you're observing here is that each time you push your work from your local repository to your BitBucket one, the tip is assigned to the latest commit you did on your local repository. By default, BitBucket start showing you the tip, and as far as I know, ther is no way to change that, but you can easily navigate from one branch to another in the source viewer.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号