3 ms·
To a lot of the people who prefer Hg to Git, I ask this question: What's the proper way to do a feature branch in Hg? (serious question) The three answers I'v
by drewcrawford 17y ago
To a lot of the people who prefer Hg to Git, I ask this question: What's the proper way to do a feature branch in Hg? (serious question) The three answers I've heard are:
* Use hg branch <branchname> like git. The problem is this always requires me to do a push -f, which doesn't feel right...
* Use clone. Really? For a feature branch?
* Use the LocalBranches extension. Really, feature branches (the #1 productivity gain since switching to DVCS) isn't in the core code?
I have yet to find an equivalent to what I consider a core git workflow.
- stevelosh 17y agoYou could use bookmarks if it's just going to be a local branch that only you work on, and you don't want anyone else to see the branch name. I'd probably use a named branch. Yes, you have to use push -f the first time you push that branch to a remote repo, but I think of that as a "hey, do you really want other people to see this work-in-progress branch?" safeguard.
- reiddraper 17y agopush -f is what I use, "force" makes it sound more sinister than it is.
- samps 17y agopush -f is the thing. Requiring -f just makes you think twice before accidentally exposing the rest of the world to your changes without merging them.
- j_baker 17y agoHg allows local branches natively, but it tends to prefer pushing from repository to repository rather than from local branch to local branch. So you can do it either way 1 or 2 (whatever suits you). It sounds like #3 might be based on outdated information.