How to save username and password with Mercurial?

You can make an auth section in your .hgrc or Mercurial.ini file, like so: [auth] bb.prefix = https://bitbucket.org/repo/path bb.username = foo bb.password = foo_passwd The ‘bb’ part is an arbitrary identifier and is used to match prefix with username and password – handy for managing different username/password combos with different sites (prefix) You can also … Read more

Convert Mercurial project to Git [duplicate]

You can try using fast-export: cd ~ git clone https://github.com/frej/fast-export.git git init git_repo cd git_repo ~/fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo git checkout HEAD Also have a look at this SO question. If you’re using Mercurial version below 4.6, adrihanu got your back: As he stated in his comment: “In case you use Mercurial < 4.6 and you … Read more

How to search through all Git and Mercurial commits in the repository for a certain string?

You can see dangling commits with git log -g. -g, –walk-reflogs Instead of walking the commit ancestry chain, walk reflog entries from the most recent one to older ones. So you could do this to find a particular string in a commit message that is dangling: git log -g –grep=search_for_this Alternatively, if you want to … Read more

How to edit incorrect commit message in Mercurial? [duplicate]

Update: Mercurial has added –amend which should be the preferred option now. You can rollback the last commit (but only the last one) with hg rollback and then reapply it. Important: this permanently removes the latest commit (or pull). So if you’ve done a hg update that commit is no longer in your working directory … Read more

Mercurial stuck “waiting for lock”

When “waiting for lock on repository”, delete the repository file: .hg/wlock (or it may be in .hg/store/lock) When deleting the lock file, you must make sure nothing else is accessing the repository. (If the lock is a string of zeros or blank, this is almost certainly true).