Author Topic: Using version control for AutoCAD projects  (Read 19531 times)

0 Members and 1 Guest are viewing this topic.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Using version control for AutoCAD projects
« on: May 07, 2014, 11:06:32 AM »
This post isn't necessarily a question; more of a "food-for-thought" or a "just-putting-this-out-there" kind of post.

I have been working to create a consulting business (typical startup: Shoe-string budget!). I have never used Autodesk Vault but I wanted something similar so I decided to use GIT for setting up/maintaining up my projects.

Here's a 10,000 foot view of my set up.

o  I created/assembled a NAS file server and installed GIT on it (I enabled SSH and FTP of course).
        - In theory you can git by without having to install GIT on the server byt just creating the `bare' project locally and moving it over to the server before cloning it (NEVER WORK IN A `BARE' PROJECT!)

o  I set up a simple project number / directory structure.
        - [client nummber] - [year] - [job number]
        ~e.g. 001-014-001

o  I create a "bare" project on the server and check it out locally.
        - I ssh into the server and create a project.
        ~e.g. git init --bare --shared=group
        - I check it out on my machine and add files.
        ~e.g. git clone NAS:/path/to/directory

Having this setup saved my butt the other day when a few of my files became corrupted (a pretty nasty AutoCAD fatal error).

I would love to discuss/brainstorm more if anyone's interested in this topic/idea.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Using version control for AutoCAD projects
« Reply #1 on: May 07, 2014, 07:47:09 PM »
Sounds good to me, ideally you would want to create some sort of simple app for cad users to use that abstracts the git details away.
Yep, I use git for all my projects now, it's good to know you have a 'milestone' backed up and revert-able if needed.

I guess you would need to build a little app that tracks the following as a minimum:

- adding/deleting files
- committing changes/updates
- retrieving/reverting earlier revisions (checkout)

normal git stuff I know but the hardest bit would be getting the git output into your app but I imagine it could be 'piped' in easy enough.
The app would/could enforce filing and naming standards etc.

Sounds interesting, I'm in if you need a hand.
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: Using version control for AutoCAD projects
« Reply #2 on: May 07, 2014, 09:50:20 PM »
I was thinking the same thing. …I don't know .net yet so I was thinking this might be a nice project for me to learn C# with. I got about as far as grabbing a free C# book to read. :)  I guess that's a round about way of saying: run away or you will be lending a hand, foot, and arm because I'm worthless with C# or .net right now! lol

How much heavy lifting do you think I can do with C++ and a simple binary or two that can be called with a small lisp app? …I wonder if I can eliminate the "add step" (as an example). *hummm* I'm going to think about this idea a little more. This might be a lot of fun.

Let me know if you get any more ideas on the `piping in part'.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using version control for AutoCAD projects
« Reply #3 on: May 07, 2014, 10:47:12 PM »
I'd love to hear more about this, John. We have a very archaic check in/out program that copies the file from the server to the C drive for editing, then copies it back when you check it back in. This was fine until data references. When you create the data reference, it creates an xml file that is pathed to the c drive. At the moment, as soon as we create a data shortcut, we have to go and edit the xml file to path to the server. This causes all kinds of problems, and the biggest annoyance is, when you are working on a file, if you want to see the results in another file, you have to make your edits, close the file, check it in, and syncronize all references. If you need to make another change, you have to reopen the file and start the process all over. It's very cumbersome.

I've been reading some about git as a replacement, but the coding is over my head.

I was wanting to put together a check in/out system, that did version control, and had a searchable database that could be filled in with all project information (client name, job numbers, etc.), including a field for lat/long, so a kml/kmz file could be generated as the database is updated. One could open the kml in google earth and easily view all projects in a certain area.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: Using version control for AutoCAD projects
« Reply #4 on: May 08, 2014, 12:11:11 AM »
Not sure about the `project information' part but we can work that out later after I give you a brief (so you can decide if it sounds like something that might work for you).

Here is a brief overview of GIT (how you work with GIT) from the general users perspective (git commands are in all caps so you can look them up).

As a general user:
1. CLONE project from server to local system.
2. work on file (and save).
3. ADD the file.
4. COMMIT the change (with comment).
5. PUSH the change

Example project with one file (file.txt).

1. user CLONEs the project.
# git clone SERVER:/path/to/directory

2. user works on file (changes it).

3. user then stages the file for a commit with an ADD.
# git add file.txt

4. user now COMMITs the change
# git commit -m "I changed this file."

5. user can now PUSH the change back to the server.
# git push origin master

Now this is simplified a little but this is the basic workflow.

The thing I really think is cool are BRANCHes. The concept of BRANCHes is best described as if you were a software developer on a project. The MASTER BRANCH (There is always a master branch) is reserved for code/projects that compile without errors or releases. After you release the project and move on to squishing bugs. You create a BRANCH and work on the project. Once your bug is squashed you REBASE onto the MASTER BRANCH.

Like this:

# git branch bugsquash
# git checkout bugsquash
... work on project
... do saves adds and commits
# git rebase master


People can use this feature to proved design options or alternates.

All of that said, there are some GUIs for GIT you can get to eliminate the command line but a lot of GIT users just use the command line (it's faster).

Still interested? :) If you want I can set you up to play around with a project I can host on my server.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Using version control for AutoCAD projects
« Reply #5 on: May 08, 2014, 01:23:41 AM »
Hey John,
I was thinking web based but looking at what's available there might be a solution that would work already.
I haven't had a look through them yet but it would be worth a look for some ideas on what can be done though.

https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Web_Interfaces
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

BlackBox

  • King Gator
  • Posts: 3770
Re: Using version control for AutoCAD projects
« Reply #6 on: May 08, 2014, 08:56:50 AM »
Interesting topic, and good luck on the new start-up.  :-)



I cannot offer anything to the GIT side of things, other than perhaps conceptual discussion of workflow, etc... But I wanted to reiterate that you can get a FREE Autodesk Develop Network (ADN) Membership, albeit at the cost of a paid Professional Membership here.

Getting a +/- $1400 ADN Standard membership that provides access to any, and all product releases (including suites), and ADN support to help you work through potential development issues for only $100 seems highly advantageous when on a 'shoe-string' budget, IMO.

Cheers
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: Using version control for AutoCAD projects
« Reply #7 on: May 08, 2014, 09:50:15 AM »
Hey John,
I was thinking web based but looking at what's available there might be a solution that would work already.
I haven't had a look through them yet but it would be worth a look for some ideas on what can be done though.

https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Web_Interfaces

Wow! There's a lot of interfaces! Ok, thanks. Im going to look around at some of those and come up with some more ideas.

Interesting topic, and good luck on the new start-up.  :-)



I cannot offer anything to the GIT side of things, other than perhaps conceptual discussion of workflow, etc... But I wanted to reiterate that you can get a FREE Autodesk Develop Network (ADN) Membership, albeit at the cost of a paid Professional Membership here.

Getting a +/- $1400 ADN Standard membership that provides access to any, and all product releases (including suites), and ADN support to help you work through potential development issues for only $100 seems highly advantageous when on a 'shoe-string' budget, IMO.

Cheers

Good links! However right now my business plan is to increase revenue (and only that); I can not operate under assumptions that I will get more work or clients but that is a great idea BlackBox. Thank you!

Thanks. I'm giving it a good go around. I currently have two clients and this is essentially a big testing phase. My main goal was to be able to work from anywhere. I wanted to "be nimble". I have the infrastructure already set up (I worked from Starbucks the other day as a test).  …After all these years I noticed some big problems with the "old school way of thinking" and those (like the remote office) are the ones I want to change. The other area is the accountability; for example, the other reason I choose GIT was because it forced me to put more thought into my product before I do (Most firms just whip out crap drawings as quick as possible). I can do that too but I wanted to slow down a little first.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BlackBox

  • King Gator
  • Posts: 3770
Re: Using version control for AutoCAD projects
« Reply #8 on: May 08, 2014, 09:56:42 AM »
Good links! However right now my business plan is to increase revenue (and only that); I can not operate under assumptions that I will get more work or clients but that is a great idea BlackBox. Thank you!

No worries; just sharing something that I've personally benefited from.



Thanks. I'm giving it a good go around. I currently have two clients and this is essentially a big testing phase. My main goal was to be able to work from anywhere. I wanted to "be nimble". I have the infrastructure already set up (I worked from Starbucks the other day as a test).  …After all these years I noticed some big problems with the "old school way of thinking" and those (like the remote office) are the ones I want to change. The other area is the accountability; for example, the other reason I choose GIT was because it forced me to put more thought into my product before I do (Most firms just whip out crap drawings as quick as possible). I can do that too but I wanted to slow down a little first.

... Seems fitting :-D:

"How we think determines what we do, and what we do determines what we get."

Greg B

  • Seagull
  • Posts: 12417
  • Tell me a Joke!
Re: Using version control for AutoCAD projects
« Reply #9 on: May 08, 2014, 10:10:51 AM »
When you check out the file, does it lock it on the server so someone else can not check out the file as well?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Using version control for AutoCAD projects
« Reply #10 on: May 08, 2014, 10:21:47 AM »
Think it's a great idea John, albeit with some important hurdles to consider, like linked files (xrefs, excel, access files etc). While I cannot contribute I wish you mad success and will be keeping an eye on your progress.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: Using version control for AutoCAD projects
« Reply #11 on: May 08, 2014, 10:38:46 AM »
When you check out the file, does it lock it on the server so someone else can not check out the file as well?

No. That was the old school CVS method. This is "new" distributed version control where people grab a copy locally and they work on it and push back to the server. ...in theory the user will have to PULL from the server after taking an extended break from working on the files but that is not that big of a deal.

If you have a situation where two people are doing work on the same file is where it will get ugly fast! The workflow will almost have to be to diversify the work load so this wont be an issue.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BlackBox

  • King Gator
  • Posts: 3770
Re: Using version control for AutoCAD projects
« Reply #12 on: May 08, 2014, 10:46:11 AM »
When you check out the file, does it lock it on the server so someone else can not check out the file as well?

No. That was the old school CVS method. This is "new" distributed version control where people grab a copy locally and they work on it and push back to the server. ...in theory the user will have to PULL from the server after taking an extended break from working on the files but that is not that big of a deal.

If you have a situation where two people are doing work on the same file is where it will get ugly fast! The workflow will almost have to be to diversify the work load so this wont be an issue.

You might reference Offline Files' four modes of operation... If memory serves slow-link mode is where when local cache file is newer than server file, the server file is made inaccessible by others from within the server folder (it's there, just inaccessible to anyone but the current file owner so-to-speak), and only becomes available on server again when manual sync is performed. Whereas online mode, continuously keeps server and local cache file in sync, so others can reference in real-time; not sure how it would work with two or more attempting to open server file though (not just XREF).

At my former employer, and for years, I used Offline Files extensively for production both in the office, and from home in lieu of VPN... The only real issue I experienced was that SSM doesn't like offline files, even though all drive mappings remain, so there's no broken DREF, XREF, folder shortcuts, etc.

HTH
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: Using version control for AutoCAD projects
« Reply #13 on: May 08, 2014, 11:00:29 AM »
Think it's a great idea John, albeit with some important hurdles to consider, like linked files (xrefs, excel, access files etc). While I cannot contribute I wish you mad success and will be keeping an eye on your progress.

I thought about that too. Work flow is good; take for example a two file set up (the simplest example): I have to be disciplined to work on one task at time and stage my commit so that both are committed.
~E.G.: The task is to make a change (in file1) and make a new PDF (of file2 which refs file1).
If there isn't a need to save file2 for just plotting all is good; make change, plot and commit file1.
otherwise I need to stay on track and work on both files (save them) and make sure they are both committed at the same time.

Thanks MP. It's fun so far.

TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: Using version control for AutoCAD projects
« Reply #14 on: May 08, 2014, 11:03:45 AM »
When you check out the file, does it lock it on the server so someone else can not check out the file as well?

No. That was the old school CVS method. This is "new" distributed version control where people grab a copy locally and they work on it and push back to the server. ...in theory the user will have to PULL from the server after taking an extended break from working on the files but that is not that big of a deal.

If you have a situation where two people are doing work on the same file is where it will get ugly fast! The workflow will almost have to be to diversify the work load so this wont be an issue.

You might reference Offline Files' four modes of operation... If memory serves slow-link mode is where when local cache file is newer than server file, the server file is made inaccessible by others from within the server folder (it's there, just inaccessible to anyone but the current file owner so-to-speak), and only becomes available on server again when manual sync is performed. Whereas online mode, continuously keeps server and local cache file in sync, so others can reference in real-time; not sure how it would work with two or more attempting to open server file though (not just XREF).

At my former employer, and for years, I used Offline Files extensively for production both in the office, and from home in lieu of VPN... The only real issue I experienced was that SSM doesn't like offline files, even though all drive mappings remain, so there's no broken DREF, XREF, folder shortcuts, etc.

HTH

*hummm*
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org