144 lines
9.5 KiB
HTML
144 lines
9.5 KiB
HTML
<html><head><title>Arch Git</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type='text/css' href='wiki.css' rel='stylesheet'></head><body><h1>Arch Git</h1></div>
|
||
|
||
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><table class="fcinfobox wikitable ct" >
|
||
<tr>
|
||
<td class="ctTitle">
|
||
<h3><span class="mw-headline" id="Arch_Git.E2.80.8F.E2.80.8E"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Arch_Git.png" class="image"><img alt="Arch Git.png" src="32px-Arch_Git.png" width="32" height="32" srcset="/wiki/images/thumb/e/e3/Arch_Git.png/48px-Arch_Git.png 1.5x, /wiki/images/thumb/e/e3/Arch_Git.png/64px-Arch_Git.png 2x" /></a> Arch Git</span></h3>
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Menu location
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">Arch → Utilities → Git
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Workbenches
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven"><a href="Arch_Module.html" title="Arch Module">Arch</a>
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Default shortcut
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">See also
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">
|
||
</td></tr>
|
||
<tr>
|
||
<td class="ctToc"><br /><div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
|
||
<ul>
|
||
<li class="toclevel-1"><a href="#Arch_Git.E2.80.8F.E2.80.8E"><span class="tocnumber">1</span> <span class="toctext">Arch Git</span></a></li>
|
||
<li class="toclevel-1 tocsection-1"><a href="#Description"><span class="tocnumber">2</span> <span class="toctext">Description</span></a></li>
|
||
<li class="toclevel-1 tocsection-2"><a href="#How_to_use"><span class="tocnumber">3</span> <span class="toctext">How to use</span></a></li>
|
||
<li class="toclevel-1 tocsection-3"><a href="#Options"><span class="tocnumber">4</span> <span class="toctext">Options</span></a></li>
|
||
<li class="toclevel-1 tocsection-4"><a href="#Enabling_human-readable_diff_for_FCStd_files"><span class="tocnumber">5</span> <span class="toctext">Enabling human-readable diff for FCStd files</span></a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
</td></tr></table>
|
||
<p><br />
|
||
</p><p><b>Note:</b> Starting from FreeCAD v0.17, this tool has been removed from the Arch Workbench and is now part of the external Webtools Workbench that you can install via menu Tools -> Addons Manager
|
||
</p>
|
||
<h2><span class="mw-headline" id="Description">Description</span></h2>
|
||
<p>This command allows to manage the current document with <a rel="nofollow" class="external text" href="https://en.wikipedia.org/wiki/Git_%28software%29">GIT</a>. GIT is a powerful file version control system, which can manage different versions of files and keep track of the changes.
|
||
</p><p>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.
|
||
</p><p>Current limitations:
|
||
</p>
|
||
<ul><li> 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)</li>
|
||
<li> The tool cannot change or create branches. You must do that manually with standard Git tools.</li></ul>
|
||
<p><b>Note:</b> To be able to use this command, the <a rel="nofollow" class="external text" href="https://github.com/gitpython-developers/GitPython">gitpython</a> package must be installed on your system. On most linux distributions, gitpython is available from the standard software repositories as <i>gitpython</i> or <i>python-git</i>.
|
||
</p>
|
||
<h2><span class="mw-headline" id="How_to_use">How to use</span></h2>
|
||
<ol><li> Save the current active document</li>
|
||
<li> Make sure the saved file is inside an existing git repository</li>
|
||
<li> Select menu Arch -> Utilities -> <span style="background: #DDDDDD; border: 1px solid #888888; padding: 0px 5px 1px 5px;"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Arch_CommitGit.png" class="image"><img alt="Arch CommitGit.png" src="16px-Arch_CommitGit.png" width="16" height="16" srcset="/wiki/images/thumb/f/ff/Arch_CommitGit.png/24px-Arch_CommitGit.png 1.5x, /wiki/images/thumb/f/ff/Arch_CommitGit.png/32px-Arch_CommitGit.png 2x" /></a> <a class="mw-selflink selflink">Git</a></span></li></ol>
|
||
<h2><span class="mw-headline" id="Options">Options</span></h2>
|
||
<div class="floatright"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Arch_Git_panel.jpg" class="image"><img alt="Arch Git panel.jpg" src="Arch_Git_panel.jpg" width="259" height="667" /></a></div>
|
||
<ul><li> Make sure the <b>Report Window</b> is open since Git messages will be printed there.</li>
|
||
<li> The Git tool will only open if the current file is saved inside a Git repository. It can be in a subdirectory.</li>
|
||
<li> The <b>Log</b> button will pop up a dialog showing the most recent log entries.</li>
|
||
<li> The <b>Refresh</b> button will re-scan the repository for changed files.</li>
|
||
<li> The <b>Diff</b> button will show the differences between the current version of a selected file and the previous version stored in the repository.</li>
|
||
<li> The <b>Select all</b> button will select all files to be committed.</li>
|
||
<li> The <b>Commit</b> button will commit the selected files. Be sure to write a commit message that describes the changes you are committing.</li>
|
||
<li> The <b>Pull</b> button will <b>download</b> 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.</li>
|
||
<li> The <b>Push</b> button will <b>upload</b> your latest commit(s) to the selected remote.</li></ul>
|
||
<h2><span class="mw-headline" id="Enabling_human-readable_diff_for_FCStd_files">Enabling human-readable diff for FCStd files</span></h2>
|
||
<p>FreeCAD's <a href="Fcstd_file_format.html" class="mw-redirect" title="Fcstd file format">Fcstd file format</a> 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.
|
||
</p><p>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 <a rel="nofollow" class="external text" href="https://github.com/FreeCAD/FreeCAD/blob/master/src/Tools/fcinfo">fcinfo</a>. 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.
|
||
</p><p>Example of a diff produced with fcinfo:
|
||
</p>
|
||
<pre>diff --git a/testhouse.FcStd b/testhouse.FcStd
|
||
index 08077b6..985b1d8 100644
|
||
--- a/testhouse.FcStd
|
||
+++ b/testhouse.FcStd
|
||
@@ -1,26 +1,25 @@
|
||
-Document: /tmp/43un09_testhouse.FcStd (442K)
|
||
- SHA1: 67c1985a45d93cba57d5bf44490897aba460100d
|
||
+Document: /tmp/zfXoDd_testhouse.FcStd (370K)
|
||
+ SHA1: db1cb5fca18af7bfdca849028f40550df4d845cb
|
||
Comment : This is a test house to showcase FreeCAD's BIM worflow and IFC export capabilities
|
||
Company : uncreated.net
|
||
CreatedBy : Yorik van Havre
|
||
CreationDate : Fri May 9 12:05:54 2014
|
||
FileVersion : 1
|
||
Id :
|
||
- Label : testhouse
|
||
- LastModifiedBy : Yorik van Havre
|
||
- LastModifiedDate : 2016-06-28T17:05:57-03:00
|
||
+ Label : testhouse2
|
||
+ LastModifiedBy : Yorik van Havre
|
||
+ LastModifiedDate : Sat Sep 13 20:46:36 2014
|
||
+
|
||
License : CC-BY 3.0
|
||
LicenseURL : http://creativecommons.org/licenses/by/3.0/
|
||
- ProgramVersion : 0.17R7800 (Git)
|
||
- TipName :
|
||
+ ProgramVersion : 0.15R3989 (Git)
|
||
Uid : 67e62d8a-6674-4358-92fe-615443be887a
|
||
- Objects: (231)
|
||
+ Objects: (221)
|
||
Annotation : Drawing::FeatureViewAnnotation
|
||
Annotation001 : Drawing::FeatureViewAnnotation
|
||
Annotation002 : Drawing::FeatureViewAnnotation
|
||
Annotation003 : Drawing::FeatureViewAnnotation
|
||
- Annotation004 : Drawing::FeatureViewAnnotation
|
||
- Annotation005 : Drawing::FeatureViewAnnotation
|
||
Array : Part::FeaturePython (9K)
|
||
Box : Part::Box (2K)
|
||
Building : App::DocumentObjectGroupPython
|
||
@@ -110,7 +109,7 @@ Document: /tmp/43un09_testhouse.FcStd (442K)
|
||
Floor : App::DocumentObjectGroupPython
|
||
Floor001 : App::DocumentObjectGroupPython
|
||
Floor002 : App::DocumentObjectGroupPython
|
||
- Frame : Part::FeaturePython (89K) </pre>
|
||
<p>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.
|
||
</p><p>To enable the use of fcinfo (Linux and Mac only - TODO: add Windows instructions)
|
||
</p>
|
||
<ol><li> Save the fcinfo file somewhere in your system path</li>
|
||
<li> Make it executalbe</li>
|
||
<li> Create a .gitattributes file in your Git repository</li>
|
||
<li> Add the following line in it:</li></ol>
|
||
<pre>*.FCStd diff=fcinfo
|
||
</pre>
|
||
<div style="clear:both"></div>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
</div><div class="printfooter">
|
||
Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=Arch_Git&oldid=251650">http://www.freecadweb.org/wiki/index.php?title=Arch_Git&oldid=251650</a>"</div>
|
||
<div id="catlinks" class="catlinks" data-mw="interface"></div><div class="visualClear"></div>
|
||
</div>
|
||
</div>
|
||
<div id="mw-navigation">
|
||
<h2>Navigation menu</h2>
|
||
|
||
</body></html> |