Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git equivalent of 'hg serve'?

Tags:

git

mercurial

Is there some sort of addon you can use to have a git equivalent of the Mercurial

hg serve 

('hg serve' starts a local web-server which allows you to browse the repository history/branches etc)

like image 420
glaucon Avatar asked Mar 27 '13 22:03

glaucon


People also ask

What is Hg in Git?

The Hg-Git plugin can convert commits/changesets losslessly from one system to another, so you can push via a Mercurial repository and another Mercurial client can pull it. In theory, the changeset IDs should not change, although this may not hold true for complex histories. Commands.

Is there a Github for Mercurial?

The answer is: yes, it can! You will be able to do that by using the Mercurial bookmark, which are the Mercurial counterpart of Git branches and are used as such by the hggit plugin.

Does anyone use Mercurial?

According to Chan, less than 1 per cent of new Bitbucket users choose Mercurial as their version control system. And she cites data from StackOverflow's 2018 Developer Survey that's no less damning: 87 per cent of developers use Git and only about 4 per cent user Mercurial.


1 Answers

For just browsing files and revisions git instaweb is the right solution.

In addition if you want to set-up an ad-hoc git server for sharing work (push/pull) with some colleagues (which hg serve also allows you to do), you can use:

git daemon --reuseaddr --base-path=. --export-all --verbose --enable=receive-pack 

Your colleagues will use it with something like:

git clone git://<ip-address>/.git project 

Addition 1:

If you want to be able to push to this server, you need to add the --enable=receive-pack option (Thanks to Dominik below).

Addition 2:

It just happened to me so I add it to the answer :-), if you are using a Redhat-based Linux distribution (RHEL, CentOS, etc.) and have an error "git: 'daemon' is not a git command.", then you need to install a seperate package for it:

sudo yum install git-daemon 
like image 50
Christophe Muller Avatar answered Oct 14 '22 12:10

Christophe Muller