Mar 2, 2018 6:15:41 PM seb leridon avatar

Synchronization of GitHub repositories

A shell script is available to make it easier to synchronize GITHub GIT repositories to the desktop. The synchronization command is: sync

The script will drop all new lutece-platform and lutece-public-sector repositories and synchronize existing repositories.



You must have the following applications:

  • cURL
  • git
  • script


You must have the following applications:

  • git bash
  • script


Debian / Ubuntu

You can install the necessary software with the following command in root:

root apt-get install curl git

Centos / Fedora / Red Hat

You can install the necessary software with the following command in root:

root # yum install curl git

or with dnf:

root # dnf install curl git


The software "Git for Windows" brings a graphical interface for GIT as well as Git Bash. You can download the latest version on this one:

It is important to check the box to launch .sh scripts with bash git.


You must download on github at the following address:


You can type these commands to use the script:

$ wget "" -O "$ {HOME} /"
$ chmod + x "$ {HOME} /"

Proxy or proxy

To configure a proxy server on linux or on windows (git bash), you can add these lines to the .bashrc file located in your $ HOME folder:

export HTTP_PROXY = "http: // user: password@mon.proxy: 3128 /"
export http_proxy = "$ HTTP_PROXY"
export https_proxy = "$ HTTP_PROXY"

Little explanation:

  • http: - the protocol to use by your proxy server,
  • user - the login to authenticate to the proxy server (optional),
  • password - the password linked to your login (optional),
  • my.proxy - the IP address or host of the proxy server,
  • 3128 - the port on which your proxy server is waiting for requests


Under linux, there is already the .bashrc script in your home (vi ~ / .bashrc), so add these lines at the end of the file.


It may be necessary to create an environment variable for the HOME under git bash, for this it is necessary:

  • press the "windows" + "pause" keys,
  • in the window that opens, select "advanced settings",
  • click on the "environment variables" button,
  • finally add the variable HOME (in capitals) and in value you can put, for example, C: \ Users \ User \.

For curl to work properly, it is also necessary (if you use mintty, the console with colors and resizable, unlike the normal console of windows) with the current version of git for windows (2017-06-07) to revive a shell with console support for native windows programs:

$ winpty bash

Use the script

In a terminal, you can synchronize github repositories with the command: sync

Advanced use

The script can take different parameters depending on what you want to do. It is possible to know all the parameters by launching the script without parameters:

Here are some examples of uses:

  • using an SSH key: sync -t ssh
  • without questioning: sync -u "Jean Martin" -e
  • specifying a specific synchronization path: sync path / to_my_folder_lutece / git
  • with an SSH key, without questioning in a specific directory: sync -t ssh -e -u "Jean Martin" lutece / git
  • modify my email (for commit): config -e



You can create an alias to launch your order faster. Suppose your order is: -t ssh sync lutece / git

You must add to the .bashrc file, this line:

alias lutece = "$ {HOME} / sync -t ssh lutece / git"

Then restart the terminal or type the command: source ~ / .bashrc


You can create a shortcut on the desktop that will launch your order. Suppose the script is in: C: \ Users \ Me \ [quot ;.

  • Create a shortcut on the desktop (right click on the desktop: " new " = > [[short;
  • name it as you want
  • in the " command line " write : [Quot; C: \ Users \ Me \ " [Quot; C: \ Users \ Me \ Projects \ lutece \ git " You just have to double-click to update your repositories.