git –bare clone analogue for Hg (Mercurial)

I want to checkout only history of a repository.

Does there any option to clone history as like as git --bare clone <repo_url> option?

  • How to checkout remote git tag
  • Overlay branches in Git (Perforce)
  • Get Travis Shield on Github to Reflect Selected Branch Status
  • How does visual studio 2013 remember the mapping between a remote git/tfs repository and a local path?
  • .sln file went missing after Visual Studio crashed
  • How to get database credentials into a c# application without committing it to source code?
  • git submodule init does absolutely nothing
  • Git - how to force manual merge even if there is no conflict
  • Git repository was suddenly broken
  • My project return error timeout after 10min
  • git update hook: Finding all revs being committed
  • Where is this value in my configuration coming from?
  • 2 Solutions collect form web for “git –bare clone analogue for Hg (Mercurial)”

    @vampire has your answer for a new clone. For an existing one hg update null does the job. That checks out the null revision, which is the revision before revision 0, and contains no files. If you check out that revision you local files go away and you’ve got a bare clone.

    I don’t use Mercurial, but from the help I’d say the nearest you will get is

    -U –noupdate the clone will include an empty working directory (only a repository)

    Update as per answer of @Ry4anBrase:

    For an existing repository hg update null deletes all local files. This checks out the null revision, which is the revision before revision 0, and contains no files. If you check out that revision you local files go away and you’ve got a bare clone as a result.

    Git Baby is a git and github fan, let's start git clone.