Can I use git with .dwg (autocad)?
Asked Answered
Z

6

13

Version control with .dwg is really a problem. I'm wondering if it is possible to use git to control the version? or just commit my changes in the file?

If this is not possible, then what is a good way of version control .dwg?

I find this: Can GIT, Mercurial, SVN, or other version control tools work well when project tree has binary files? It says svn works with cad, is it the only solution now?

Zygo answered 29/9, 2015 at 7:40 Comment(2)
In theory, you can use Git to track any type of file. In practice, however, tracking binary files such as .dwg files is trickier. Don't expect to make much sense of Git's diffs, unless you use a third-party diff tool adapted to .dwg.Survive
Just a couple off-the-cuff thoughts... Some paid (on the low end) approaches: Autodesk Vault, MS Sharepoint. Free options: Some Cloud Storage should like OneDrive (at least I know it does with other doc types... haven't checked with dwg).Voiture
B
5

Normally source control is most effective on TEXT files, I would therefore consider to use the TEXT version of DWG files: DXF.

Berneta answered 29/9, 2015 at 14:1 Comment(3)
dxf is good, but autocad alwasy save as dwg automatically, is therey anyway that I can work with dxf by default? Otherwise everytime I need to save it to dxf to version control, which is realy tedious.Zygo
Once a drawing is opened as DXF it should be saved automatically as DXFBerneta
Dxf is text format, but it is not human readable and not auto merged. So you have no profit to treat it as no-binary with your git clientSaloon
R
4

Autodesk ships Vault with every copy of AutoCAD (or you can download it from their website) for free.

Raceme answered 29/9, 2015 at 14:14 Comment(2)
I watched the video, which is really impressive. But when I try to find the download, and tutorials I find its just really heavy, and not very easy to use I might guess.Zygo
It's really pretty simple once it's installed (*at least the free version) as there aren't too many features. It's version based, not revision and branching of files is limited but is possible.The only problem I have with Vault is checking files in or out usually has to be completed from within AutoCAD as the standalone Vault application can't properly detect file dependencies like attached images or xrefs.Raceme
D
4

DWG files are binaries so using a version control system is less than ideal. You would be better off using Dropbox or something similar if you want a zero-effort version system that is distributed. They keep versions for 30 days in the free account or a year in a paid account. DXF is a red-herring in most cases, don't chase that rabbit.

Another thing you could do (I do this for a few clients) is work in a different folder than the archive. When you are ready to commit a version then sync the working folder with the archive. I use Free File Sync but Watch out for Adware in it. I jsut installed v7.5. MalwareBytes said it was ok. It asked me if I wanted Opera browser during the install (nothankyou) but no other weird stuff happened. Looks like they (too) have dropped MalwareForge...er, SourceForge.

back to the answer...

The versioning happens in Free File Sync in the option to /replace/delete files. You want Versioning, from their site ...

2. Keep all versions of old files

Set deletion handling to Versioning and naming convention to Time stamp. FreeFileSync will move deleted files into the provided folder and add a time stamp to each file name. The structure of the synchronized folders is preserved so that old versions of a file can be conveniently accessed via a file browser.

Example: A file Folder\File.txt was updated three times and old versions were moved to folder C:\Revisions

C:\Revisions\Folder\File.txt 2012-12-12 111111.txt C:\Revisions\Folder\File.txt 2012-12-12 122222.txt C:\Revisions\Folder\File.txt 2012-12-12 133333.txt

I use this timestamp: %timestamp% e. g. 2012-12-22 123044 format: [YYYY-MM-DD hhmmss]

You will end up with a lot of files but they are easy to find and open. This has worked well for me for a few years now.

The biggest annoyance here is merge conflicts but Git was going to bite you with this anyway. If files are edited in both places the Free File Sync will flag the conflict and you will have to solve that mystery yourself.

Dropbox's downside is similar but it will merge silently. That's not good. If someone else is in the same folder on a different machine then don't expect write locks and the *.dwl lock files to work.

Discourse answered 15/10, 2015 at 2:30 Comment(0)
L
2

If you are part of an industry where people can reasonably expect people contributing to a 'common data environment' to keep transmittal records of when each version of each controlled document was provided to whom, then git maintains that document register in a form much closer to a traditional transmittal or document register.

There is also the capacity for branching and milestone archiving in git:

  • explore an option study in a branch separate from the 'current' version;
  • look at a drawing transmittal (pull request) from an external party and review it or fix it before merging it into the 'current' version visible to the whole team;
  • implement an ISO 9001 review process for internal sign off of a branch (proposed transmittal) before it is permitted to be committed to the team's common data environment;
  • save milestones of the current controlled document set at key milestones like development approval, building approval, tender issue, any tender addenda, construction issue. Checkout the milestone issue and browse the filesystem tree just as it was at that milestone. Compare what has changed between then and some other milestone.

As noted above, it is worth noting that most CAD deliverables for construction are proprietary binary formats, like your DWGs and PDFs. These do lose a lot of the other potential points of difference of git versus a basic file syncing tool like dropbox. They are not stored in git as efficiently as a text file. They are stored in some sort of special binary blob 'annex'. On the other hand the loss of the ability to confirm who wrote every word on every line of every document is not a reason to discard the other whole of document version control benefits of git over a cloud file syncing service with a single 'current' state. The github desktop client is a pretty good tool for non-technical people to see a list of altered documents between two states of the project history.

At least in construction with the shift to open standards for BIM collaboration between entities using text based ISO standard file formats like IFC we are on the cusp of a future where 3D models in a structured text file are the deliverable contract documents. I for one would like to be ready with a working understanding of how to use something like git to have a cryptographic signature on a commit that defines who is responsible for every element and property in the federated model, with revision descriptions. My brief investigations of this tend to suggest that ifcxml diffs are a lot easier to make useful sense of than ifc. The work to produce automatically validated simple ifcxml files to match ISO 19650 'information requirements' looks like the way a thoughtfully lazy person might want to set something up. As such, there is also some future proofing scope for git as a common data environment for DWGs, even if they are not fully realisable at present.

You may even convince an entire project team to exchange documents in dxf format. Unless you are drafting all the contracts and reviewing their progress claims, that sounds pretty much like sparkly rainbow unicorn territory to me.

Alternatively we could all continue to use dropbox and excel document registers with a scanned signature on the 12 page pdf, to validate who authorised the documents' release, then do all the rest of the document control in jellyware. It'll probably all be fine until someone calls their lawyer. If there is a problem, the jellyware approach just requires endless hours of super fun busy work that should get any lawyer on hourly rates a bit excited. They could even load each milestone into a git repository and have git present the transmittal history to them so they can work out who's dead tree transmittal to attack.

Lueck answered 5/5, 2019 at 2:35 Comment(0)
B
1

If you want see the changes you need a specialized tool , the only one I am familiar with is Vico Doc Set Manager - http://www.vicosoftware.com/products/vico-doc-set-manager-/tabid/87528/ . I think Autodesk Vault has a plugin for doing this.

Bradleigh answered 3/11, 2015 at 7:41 Comment(0)
W
1

If You like just to be able to track the history, move back and forth in time then GIT and Autodesk Vault (since dwg is proprietary Autodesk solutions are usually a first choice) are almost equal. None of them can do the diff of dwg files. Yes, Autodesk product can't do diff on Autodesk files.

If Your main operation is through GUI both are also comparable, although for GIT You have much wider choice.

Git, when You will get advanced, will allow You to do much more things that Autodesk Vault can do. The most critical thing is "history branching" without which any serious job is impossible. Remember those file "version with something.dwg", "need to try this.dwg" and so on? With GIT you can just use "alternative history".

Git will struggle a bit with attempts to figure out differential compression between files, so with large binary files You may expect some slow down. You do have however two options:

  • to tell GIT that file is binary, so not to struggle or (check .gitattributes options);
  • to tell GIT to handle files through so called GIT-LFS extension.

Also GIT should be configured in such a way so that it would never attempt to do any file modification. I do mention it, because it may be configured to, for an example, change "end-of-line" characters between Linux and Windows. I'm not sure what are defaults, because I always configure it to "don't touch files".

I do use GIT for Autodesk Inventor, LibreOffice and other files. No problems, except large disk consumption and lack of ability to see differences between versions. But what to expect, if You need to keep 50 or more copies to track the history?

Good side of GIT is, that You don't have to have any kind of server to benefit from it. It will keep the history on Your disk and You don't have to share it with anyone. You may, if You like, but You do not have to. This is a low investment starting point which is worth to try. Surely You will find some limitations, but in my case this is a good and cost effective tool.

Watchdog answered 1/12, 2021 at 13:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.