WebTools Git/fr

Description
Cette commande permet de déposer le document actif à dans un référentiel GIT. Le document actif doit être enregistré à l'avance, et puis part dans un dépôt GIT, configuré à l'extérieur de FreeCAD.

Git is a complex tool, consider learning the basics of it before using this tool, to avoid wrong operations that can cause data loss. An abundant literature about GIT is available and easy to find on the internet.

Current limitations:


 * The tool cannot create new repositories yet. You must have an existing local repository already created (FreeCAD will check if the current document file is inside a Git repository)
 * The tool cannot change or create branches. You must do that manually with standard Git tools.

PS:' pour pouvoir utiliser cette commande, le paquet gitpython doit être installé sur votre système. Sur la plupart des distributions Linux, gitpython est disponible à partir des dépôts de logiciels standards comme gitpython ou python-git.

Utilisation

 * 1) Sauvez le document actif
 * 2) Assurez-vous que le fichier enregistré fait déjà partie d'un git repository
 * 3) Selectionnez menu Arch → Utilities →

Options



 * Vous ne devez "commiter" que le fichier sauvé par FreeCAD, ou tous les fichiers modifiés et qui sont aussi dans le GIT.
 * Vous pouvez optionnellement aussi "pousser" la branche par défaut dans la branche GIT courante.

Enabling human-readable diff for FCStd files
FreeCAD's Fcstd file format is a zip-based binary format, for which Git cannot produce proper diffs. This means that you cannot see what has changed between one version and another, and also that each new version stored in the Git repository is a full copy of the file.

Although the second problem currently has no solution, the first one can be solved with a little tool available from the FreeCAD source code, called fcinfo. Git can be told to use the fcinfo utility to print a human-friendly report of a FCStd file, and, when asked to produce a diff between two FCStd files, will produce a diff between the two fcinfo reports instead. Please note that this is only visual feedback, a full copy of the file will still be stored internally.

Example of a diff produced with fcinfo:

Each FreeCAD file contains a SHA1 checksum number, which will change each time the file is saved, even if no contents was changed. So fcinfo will always print something, no matter of the contents changes.

To enable the use of fcinfo (Linux and Mac only - TODO: add Windows instructions)

*.FCStd diff=fcinfo
 * 1) Save the fcinfo file somewhere in your system path
 * 2) Make it executalbe
 * 3) Create a .gitattributes file in your Git repository
 * 4) Add the following line in it: