# Contribute with Git

Contributing to the project using `git` is possible thanks to
[git-remote-hg](https://github.com/felipec/git-remote-hg). You still need to have
[mercurial](../contribute/dev-tools.md) installed.

```{warning}
This method using a Git client is a bit experimental and we don't really know what
will happen if another developer touches your branch (which is common with our
Mercurial workflow). The overall developer experience will of course be better with
a Mercurial client.

However, this is a good solution for simple contributions.
```

Add the `git-remote-hg` script anywhere in your \$PATH:

```sh
curl https://raw.githubusercontent.com/felipec/git-remote-hg/topic/git-remote-hg -o ~/bin/git-remote-hg
chmod +x ~/bin/git-remote-hg
```

```{note}
We are downloading the `topic` branch of the project to be compatible with our
Mercurial workflow based on topics.
```

Then your workflow to contribute to, for example, these pages will be:

- clone the repository

```
$ git clone "hg::ssh://hg@foss.heptapod.net/py-edu-fr/py-edu-fr.pages.heptapod.net"
$ cd py-edu-fr.pages.heptapod.net
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
$ git remote -v
origin	hg::ssh://hg@foss.heptapod.net/py-edu-fr/py-edu-fr.pages.heptapod.net (fetch)
origin	hg::ssh://hg@foss.heptapod.net/py-edu-fr/py-edu-fr.pages.heptapod.net (push)
```

- create a new branch

```sh
git checkout -b topics/changes-with-git
```

- make some modifications and commit

```sh
git commit -a -m "commit my changes"
```

- push

```sh
git push origin topics/changes-with-git
```
