Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As a mercurial user I look and that and go... gee that's complicated. All the 'origins' and named 'master' and email addresses and extra stuff.

for ref the equivs are:

1. hg init

2. hg commit -m "message"

3. hg branch newbranch

4. hg update branchname

5. hg merge branchname

6. hg push




How does hg know where to push to? (honest question)


It has a default setting. You can set the default in your .hg file. When you pull your repo from somewhere that becomes the default. You can also specify where you want to push to.

eg.

hg push ssh://hg@bitbucket.org/myusermame/project

or

hg push https://username:password@code.google.com/p/project/


You edit .hg/hgrc. You also must run:

  hg outgoing
What I'm interested in is how to switch to a different branch.


To switch to a branch you go

hg update branchname

If you have uncommited changes it will refuse. You can 'shelve' the changes or force the update to the branch (with a flag on the command line).


Interesting... must have a look at hg!

But I'm not really sure that pushing is that much of a difficult concept, because you just have to add a remote and then use this to do your push. Not really that much of a difference...

Edit: I've just realized... I probably need to clarify the command:

  git remote add origin git@example.com:my_project.git
The only git keywords here are "remote add". Origin could be named anything you want (call it "external"), and the git@example.com:my_project.git is actually what points to the git remote repository. You can also use the same style URI if you want to use SSH, or even HTTP(S).




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: