Dynare repository has now migrated from Subversion (SVN) to Git.

The oustanding differences between Git and SVN are:

Installing and configuring Git

Under Windows

You need to install two packages (actually the first package is enough if you are familiar with the command line):

/!\ If you also have Cygwin installed, make sure that the git package of Cygwin is not installed, or if it is installed it is not in your system path. Otherwise it will create conflicts.

Then you need to give your identity to Git (needed for identifying the commits): in the "TortoiseGit" menu, run the "Settings" application, and then configure your identity (fullname and e-mail address) in the "Git/Config" submenu.

Under Linux

Just install the "git" package (or "git-core" for older distributions); you may also be interested in the "git-doc" package.

Then you need to give your identity to Git (needed for identifying the commits):

$ git config --global user.name "Your Name Comes Here"
$ git config --global user.email you@yourdomain.example.com

Workflow for Dynare users

For users who want to track daily development of Dynare, only two commands are needed (very much like with Subversion).

Under Windows

Open an explorer window to the place where you want to put your working copy, then right click in the window and select « Git clone... ». In the Url entry, enter:

http://www.dynare.org/git/dynare.git

For getting regular updates, right-click on the directory of the local copy, and click "Git sync...", then "Pull".

Under Linux

Initial setup:

git clone http://www.dynare.org/git/dynare.git

(equivalent of SVN checkout)

This will store Dynare source code in local directory dynare.

For regular updates, go into that directory and type:

git pull

(equivalent of SVN update)

Workflow for Dynare developers

We have adopted a decentralized architecture, similar to that of Github (see there).

Of course, there is still be a central public repository.

But along with that, each developer has his own public repository on the Kirikou server, on which he pushes his modifications.

Once these modifications are ready to be integrated in the official central repository (possibly after review by another developer), they will be integrated in the central repository by an integrator (Michel, Stéphane or Sébastien).

An important point to understand is that the "commit" command is different from SVN: in Git, when you commit, the change is only registered in your local repository (on your local computer). It will not be made public until you publish it on your personal public repository (located on Kirikou) with the "push" command.

To be more concrete, the workflow for a developer is the following:

Access to the public individual repositories will be done using SSH, with public keys. Each developer should therefore install an SSH client and setup an SSH key (see below).

Under Windows

Initial setup

If you don't already have an account on Kirikou, generate an SSH key for identifying yourself on Kirikou: from the "TortoiseGit" application menu, run the "PuttyGen" application. Enter a passphrase to protect your key. Save the private key on a file on your hardrive (with PPK extension). Then send the public key (given in the box titled « Public key for pasting into OpenSSH... ») to SébastienVillemot.

In return, you will get by e-mail a login on Kirikou. A personal public repository will also be created on Kirikou.

You can download a working copy of Dynare Git repository:

Now you have a clone of the public central repository of Dynare. From the point of view of Git, this repository is called "origin".

You now need to configure the address of your personal public repository on Kirikou:

Daily workflow

Note: you should keep Pageant always running when you are interacting with the Git server. The purpose of Pageant is to keep your SSH key and its passphrase in memory, so that you don't have to type the passphrase or specify the key every time you interact with the server.

For Linux users

Initial setup

If you don't already have an account on Kirikou, generate your SSH key with ssh-keygen (don't forget to protect it with a password), and send it to Sébastien Villemot. You will get your login in return.

Create your working copy with the following command:

git clone ssh://yourlogin@kirikou.dynare.org/srv/d_kirikou/git/dynare.git

(replace yourlogin by your real login, and verify that the SSH key fingerprint corresponds to: 5b:c9:22:3c:34:50:06:da:cf:77:15:98:e2:1c:5b:6d)

Add a remote corresponding to your personal repository:

git remote add -f personal ssh://yourlogin@kirikou.dynare.org/srv/d_kirikou/git/dynare-yourlogin.git

(replace yourlogin by your real login at two places)

Daily workflow

More about Git

You can look at the documentation available in the documentation section of the Git website.

Start reading the tutorial. Also read Git for computer scientists which explains how Git internally stores data and history: this makes the understanding of commands much easier (in particular for branching/merging).

There are Emacs modes for Git, see http://www.emacswiki.org/emacs/Git.

DynareWiki: GitHowto (last edited 2015-09-14 08:48:29 by JohannesPfeifer)