Arch Git/it

Descrizione
Questo comando consente di eseguire il commit del documento attivo a un repository GIT. GIT è un potente sistema di controllo di versione del file, è in grado di gestire diverse versioni dei file e di conservare la traccia delle modifiche.

Git è uno strumento complesso, prima di utilizzare questo strumento considerare di imparare le sue basi, al fine di evitare operazioni errate che possono causare la perdita di dati. Su internet è disponibile e facile da trovare una abbondante letteratura su GIT.

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.

Note: Per essere in grado di utilizzare questo comando, sul sistema deve essere installato il pacchetto gitpython. Sulla maggior parte delle distribuzioni Linux, gitpython è disponibile nei repository software standard come gitpython o python-git.

Utilizzo

 * 1) Salvare il documento attivo corrente
 * 2) Assicurarsi che il file salvato è già parte di un repository git
 * 3) Selezionare il menu Arch -> Utilità ->

Opzioni



 * Make sure the Report Window is open since Git messages will be printed there.
 * The Git tool will only open if the current file is saved inside a Git repository. It can be in a subdirectory.
 * The Log button will pop up a dialog showing the most recent log entries.
 * The Refresh button will re-scan the repository for changed files.
 * The Diff button will show the differences between the current version of a selected file and the previous version stored in the repository.
 * The Select all button will select all files to be committed.
 * The Commit button will commit the selected files. Be sure to write a commit message that describes the changes you are committing.
 * The Pull button will download any new changes to the repository from the selected remote. If the file currently opened in FreeCAD is being modified by a pull, a warning message will inform you so you can either save the file again or save it elsewhere.
 * The Push button will upload your latest commit(s) to the selected remote.

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: