Version Control Made Simple for Your CAD Projects
GitPDM is a FreeCAD workbench addon that brings Git version control and GitHub collaboration directly into FreeCAD. Think of it as “version history” for CAD projects, designed around FreeCAD documents, previews, and publishing.
Current Version: 0.3.0
- Tutorials — learning-oriented lessons for newcomers
- How-To Guides — goal-oriented recipes for specific tasks
- Technical Reference — accurate, “lookup-style” system details
- Explanations — background concepts and context to build understanding
Goal: Install GitPDM, create a repository, and make two commits.
Prerequisites:
- FreeCAD (0.20, 0.21, or 1.0)
- Git installed and available on PATH (
git --versionworks)
-
Find your FreeCAD Mod folder:
- Windows: Press
Windows + R, enter%APPDATA%\FreeCAD\Mod - macOS: Finder →
Cmd + Shift + G→~/Library/Application Support/FreeCAD/Mod - Linux:
~/.FreeCAD/Mod/ - Create the folder if it doesn't exist.
- Windows: Press
-
Download the latest GitPDM release:
-
Copy the extracted
GitPDMfolder into the Mod folder so you have:Mod/GitPDM/Init.pyMod/GitPDM/InitGui.pyMod/GitPDM/freecad_gitpdm/
-
Restart FreeCAD.
-
In the workbench dropdown, select Git PDM.
- In the Git PDM toolbar, click Toggle GitPDM Panel.
- In the panel, click Browse for Folder.
- Create/select an empty folder for your project (example:
Documents/FreeCAD Projects/MyFirstProject). - Click Create Repo.
- Switch to Part Design workbench.
- Create a new document: File → New.
- Create a simple box:
- Create Body → Create Sketch (XY)
- Draw a rectangle → Close
- Pad → length 10mm
- Save inside the repository folder as
simple-box.FCStd.
- Switch back to Git PDM workbench.
- In the panel, confirm
simple-box.FCStdshows up under Changes. - Enter commit message:
Add simple box part for testing - Click Commit.
- Switch to Part Design.
- Edit the Pad length from 10mm to 20mm.
- Save.
- Switch to Git PDM.
- Enter commit message:
Increase box height to 20mm - Click Commit.
You now have a local commit history you can always return to.
Goal: Authenticate to GitHub and push your local commits.
Prerequisites:
- Completed Tutorial 1
- A GitHub account
- In the GitPDM panel, click Connect GitHub.
- A dialog appears with a short code.
- Click the dialog button to open GitHub (or visit https://github.com/login/device).
- Log in, enter the code, and click Authorize.
- Return to FreeCAD and confirm it shows “Connected”.
- In the GitPDM panel, click Push.
- If prompted to set up the remote repository, follow the instructions shown.
- After success, verify your repo on GitHub at:
https://github.com/YOUR_USERNAME/YOUR_REPO_NAME
Goal-oriented recipes for specific problems.
Goal: Install Git and verify it works.
- Windows: install from https://git-scm.com/download/win, then restart; verify with
git --version. - macOS: run
git --versionin Terminal and install Xcode CLI tools if prompted. - Linux: install via your package manager (e.g.
sudo apt install git), verify withgit --version.
Goal: Push successfully when the remote moved ahead.
- Click Fetch.
- Click Pull.
- If Pull succeeds, try Push again.
- If you hit conflicts, you'll need to resolve them manually (until a dedicated UI exists).
Goal: Configure thumbnail/mesh settings.
- Create
.freecad-pdm/preset.jsonin your repository. - Add a preset (example):
{ "presetVersion": 1, "thumbnail": { "size": [1024, 1024], "projection": "perspective", "view": "isometric", "background": "#2C3E50", "showEdges": true }, "mesh": { "linearDeflection": 0.05, "angularDeflectionDeg": 20.0, "relative": false }, "stats": { "precision": 3 } } - Commit the preset.
- Run Publish Branch and confirm the outputs changed.
Goal: Make Git available to GitPDM.
- Install Git from https://git-scm.com/.
- Restart your computer (Windows commonly needs this).
- Verify in a terminal:
git --version
Goal: Successfully connect GitPDM to GitHub.
- Confirm GitHub is reachable in a browser: https://github.com/
- Confirm your system clock is correct (OAuth is time-sensitive).
- Retry Connect GitHub and complete the device flow.
- If you see “Session expired” / “Token invalid”, disconnect and connect again.
- Check FreeCAD Report View for detailed
[GitPDM]errors.
Goal: Enable secure token storage on Linux.
- Install packages:
# Ubuntu/Debian sudo apt install python3-secretstorage gnome-keyring - Ensure a Secret Service compatible keyring daemon is running.
- Retry Connect GitHub in GitPDM.
Alternative: If a keyring is not available (headless systems), use SSH for Git operations.
Goal: Allow token storage in Keychain.
- Retry Connect GitHub and approve the Keychain prompt.
- If the prompt is blocked by system policy, consider granting FreeCAD/Python appropriate permissions in System Settings → Privacy & Security.
Goal: Get PNG/GLB/JSON (and optional STL) exports working.
- Confirm the document is saved inside the repository.
- Confirm the document has visible 3D geometry.
- Confirm FreeCAD is running in GUI mode.
- If using
.freecad-pdm/preset.json, confirm it is valid JSON. - Check Report View for the specific error.
Accurate lookup documentation. Minimal narrative.
- Version control of files inside a Git repository (commit/push/pull/fetch)
- Optional GitHub integration via OAuth device flow
- Preview export and publishing pipeline (thumbnail PNG, JSON metadata, STL)
- Safety guards to reduce risk of file corruption during risky operations
Branch switching is currently limited because FreeCAD .FCStd files are ZIP archives and can be corrupted if the working directory changes while documents are open. GitPDM protects you by requiring documents to be closed for certain operations.
| Requirement | Version | Notes |
|---|---|---|
| FreeCAD | 0.20, 0.21, or 1.0 | Install from https://www.freecad.org/downloads.php |
| Git | 2.20+ | Install from https://git-scm.com/ |
| Python | 3.8+ | Bundled with FreeCAD |
| PySide2 or PySide6 | Any | Bundled with FreeCAD |
| GitHub account | N/A | Optional, for cloud features |
GitHub tokens are stored using the host platform’s secure credential store.
- Windows: Windows Credential Manager
- macOS: Keychain
- Linux: Secret Service API (GNOME Keyring / KWallet)
# Ubuntu/Debian
sudo apt install python3-secretstorage gnome-keyring
# Fedora/RHEL
sudo dnf install python3-secretstorage gnome-keyring
# Arch Linux
sudo pacman -S python-secretstorage gnome-keyring- Path:
.freecad-pdm/preset.json - Format: JSON
previews/
parts/
mechanical/
base/
preview.png
preview.json
preview.glb
GitPDM logs to FreeCAD’s Report View.
- Enable: View → Panels → Report view
- Look for messages prefixed with
[GitPDM]
Settings are stored in FreeCAD’s parameter store:
User parameter:BaseApp/Preferences/Mod/GitPDM
Access via: Tools → Edit parameters...
High-level modules:
auth/— GitHub OAuth device flow and token storagegit/— Git subprocess wrappergithub/— GitHub API clientexport/— preview generation pipelinecore/— shared utilities (logging, jobs, paths, settings)ui/— panel and handlers
- Branch switching requires care (close documents first)
- Merge conflict resolution is currently manual
- Very large repositories can be slow to scan
- GitApp integration to reduce reach of app (I realize it's currently a-lot)
- Enhanced branch/worktree UX
- Conflict resolution UI
- Git history viewer inside FreeCAD
- Improved diagnostics and more actionable error messages
- Pull request integration
- Support for additional hosting providers (GitLab/Bitbucket/self-hosted)
- Advanced Git operations for power users (rebase/cherry-pick/stash)
Discursive background material to build understanding.
CAD projects evolve through many small edits: dimension tweaks, feature additions, assembly adjustments, refactors. Without structured checkpoints, it's easy to lose work (corruption, accidental overwrite, “save-as” chaos) or forget what changed and why.
GitPDM brings Git’s history of states into FreeCAD so that saving a meaningful checkpoint becomes routine.
- Git stores history as commits in a local database (inside
.git). - GitHub hosts a remote copy of your repository for backup/sharing.
- GitPDM makes Git workflows usable inside FreeCAD, and optionally connects to GitHub.
A practical mental model:
- Commit = “make a local checkpoint on my machine.”
- Push = “copy my checkpoints to GitHub.”
A repository is a project folder plus its history store (.git). A commit is a named snapshot of the repository contents.
Commit messages matter because CAD changes can be hard to remember later. The snapshot captures the state; the message captures intent.
FreeCAD .FCStd files are ZIP archives. If the on-disk file changes underneath an open document (as can happen during a branch switch), you can get inconsistent state and corruption risk.
That’s why GitPDM takes a safety-first approach and requires closing documents for certain operations, and why worktrees are useful for multi-branch workflows.
Git is optimized for many small text changes. CAD files are larger binaries.
Git LFS (Large File Storage) stores large binaries outside the normal Git object store and keeps lightweight pointers in history. Practically, this keeps repositories more manageable as the project grows.
A regular commit is primarily for restoring and collaborating on versions.
Publishing adds shareability artifacts:
- a thumbnail image for quick scanning
- a browser-viewable 3D model (STL)
- metadata summaries (JSON)
These outputs make the repository easier to browse and understand without opening FreeCAD.
If you’re new to version control, it helps to separate the local and remote ideas:
- You don’t need deep Git knowledge to get value: a repository plus a few well-named commits already gives you durable checkpoints.
- GitHub is optional: GitPDM can be used with local-only Git, but pushing to a remote is a practical cloud backup layer.
- Still treat backups as layered: local commits + push to a remote + normal filesystem backups.
On performance:
- Git operations are intended not to freeze the UI, but very large repositories can be slower to scan.
.gitignoreand Git LFS are common ways to keep CAD repositories manageable.
If something goes wrong, the two best sources are:
- GitPDM issue tracker: https://github.com/nerd-sniped/GitPDM/issues
- FreeCAD forum: https://forum.freecadweb.org/
- Git book: https://git-scm.com/book/en/v2
- GitHub Git handbook: https://guides.github.com/introduction/git-handbook/
- FreeCAD wiki: https://wiki.freecad.org/
GitPDM builds on a lot of great work:
- FreeCAD community
- Git and GitHub ecosystems
- Qt/PySide
- Contributors and testers