19
Control Your Code: Introduction to Source Control for Programmers and CAD Managers Ben Rand Director of IT, CAD Manager, Developer Job Industrial Services, Inc.

Control Your Code: Introduction to Source Control for

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Control Your Code: Introduction to Source Control for Programmers and CAD Managers

Ben Rand

Director of IT, CAD Manager, Developer

Job Industrial Services, Inc.

About the speaker

Ben Rand

Ben has been using AutoCAD since Release 12. He learned to program

using LISP in AutoCAD, worked his way up through VBA, VB6 and

VB.NET, and now spends most of his days programming in C#

(occasionally still in AutoCAD!), and dabbling in other languages such as

Java, Ruby and Python. He has worked in the Industrial Engineering

field for more than 17 years as a CAD Manager, developer and IT

Director. In 2013, he was the 2013 Top DAUG overall winner at AU, and

he served a mentor for the AutoCAD Mentor All-Star team.

Ben is the proud father of four children and enjoys reading and playing

a variety of sports including pickleball, volleyball, and tennis. In 2018,

Ben was a member of two USTA men's league teams. The 18 and over

team won the National Championship, while the 40 and over team was

the Finalist.

Course Objectives

Create a repository for

code projects

CRCREATE REPOSITORY

CCCOMMIT CODE

PVPREVIOUS VERSIONS

MBMERGE BRANCHES

Commit code and resolve

conflicts

Compare previous versions

of files

Create and Merge Branches

What is Source Control?

Source control is a software system that tracks changes to files and folders over time.

• Language agnostic (platform and IDE specific tools)

• Backup

• Can “rewind” to any previous version of a file or the entire system

• Compare versions

• Synchronize multiple developers

• Who made a particular change?

• Avoid and resolve conflicts

• Allows “branch” development and “merging”

Key Terms

• Repository

• Working Copy

• Trunk

• Branch (or Fork)

• Merge

• Tag

• Update (or fetch, pull)

• Commit (or push)

Common Source Control Systems

• Git (https://github.com/ADN-DevTech)

• SVN—Subversion

• CVS – Concurrent Versions System

• TFS – Microsoft Team Foundation Server

• Azure DevOps (aka Visual Studio Team Services)

• Mercurial – Facebook

• Autodesk Vault

Source Control for Class (Free!)

• Visual SVN Server - https://www.visualsvn.com/server/

• Tortoise SVN - https://tortoisesvn.net/

• AnkhSVN - https://ankhsvn.open.collab.net/downloads

Trunk

Tag: v1.0 Tag: v1.1 Tag: v2.0

Branch: New Feature

Branch: Major

Refactoring

Time

Trunk, Commits, Branches and Tags

1 2

3

4

5

6

7

8

9

10

11

12

13

14

15 16

HEAD HEADHEADHEAD

1 2 3

4

5

HEAD

6

Commits and HEAD revision

x Represents a commit in the

repository

Text with image background

Image caption goes here

DEMO: Creating a Repository, Importing and Checking out Code

Text with image background

Image caption goes here

DEMO: Committing Code and Checking out Code

Text with image background

Image caption goes here

DEMO: Comparing Previous Versions, the Log, and Exporting Code

Text with image background

Image caption goes here

DEMO: Subversion and Visual Studio (AnkhSVN Plugin)

Text with image background

Image caption goes here

DEMO: Creating a Branch, Adding Externals, and Performing Merges

Trunk

Branch: New Feature

Merging

1 2

34

5

6

7

To merge the “New Feature” branch:

• All changes on branch MUST be committed (6)

• Working copy changed back to HEAD of trunk (5)

• Merge the HEAD of branch (6) into the working copy of trunk (5)

• Commit the merged code to trunk (7)

You have learned to:

•Create a repository for existing code projects

•Import code into the repository

•Check out and update code from the repository

•Commit code and resolve conflicts

•Compare previous versions of files

•Create and merge branches•Are you ready to return to work next week and start using Source Control?

▪ https://www.visualsvn.com/visualsvn/getting-started/

▪ https://tortoisesvn.net/support.html

▪ https://ankhsvn.open.collab.net/

▪ http://azuliadesigns.com/source-control/

▪ http://svnbook.red-bean.com/

▪ https://www.pluralsight.com/courses/how-git-works

▪ https://guides.github.com/activities/hello-world/

Resources

Contact Me• Email: [email protected]

• Twitter: @leadensky

• LinkedIn: www.linkedin.com/in/leadensky

2018 Courses at AU• AS197578-L: Data Mining in AutoCAD with Data Extraction

• SD195561: Control Your Code: Introduction to Source Control for Programmers and

CAD Managers

• SD226637: Clean Code: Tips for Writing Clear and Concise Code

Pluralsight Course• https://www.pluralsight.com/courses/autocad-extracting-data-drawings

Autodesk and the Autodesk logo are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document.

© 2018 Autodesk. All rights reserved.

Don’t forget to fill out your class survey

before you leave AU!