16
October 28, 2014 Sam Siewert CMVC - Using Git to Manage Source Code & Configuration https://git-scm.com/ V1 V2 V3 R1 R2 R3 file1 file2 file3 file4

CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

  • Upload
    others

  • View
    50

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

October 28, 2014 Sam Siewert

CMVC - Using Git to Manage Source Code & Configuration

https://git-scm.com/

V1

V2

V3

R1

R2

R3

file1 file2 file3 file4

Page 2: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Integration and TestIntegrate Software Modules [units] and Hardware Components into Sub-systems –CMVC is Critical at all Phases, but Can’t Live without it During I&T!!

Test Focus on Interfaces [Function, Message, Shared Memory, Hardware], Protocols, and Interoperability of Modules

Sam Siewert 2

Page 3: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Purpose of CMVCManage Revisions of Files (code) and configuration of files used to build an Application

Local Sandbox

Remote Repository

Sam Siewert 3

Page 4: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

More than One Option for CMVCServer installation (normally provided by Enterprise)– Git - https://git-scm.com/downloads, Also on PRClab– Subversion - https://subversion.apache.org– Mercurial - https://www.mercurial-scm.org/

Cloud-based– Github - https://github.com/– Bitbucket - https://bitbucket.org/– GitLab - https://about.gitlab.com/

Browsing Tools– Tortoise SVN, Tortoise Git, Tortoise Hg– Web page for Cloud-based– GitHub Desktop

Sam Siewert 4

Page 5: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

GitHub and GitHub Desktop PrimerUse CMVC from Now On– Install GitHub Desktop on Windows or Mac– Create GitHub Account - https://github.com/– Code is Public for FREE Use– Clone from siewertserau or PRClab or Desktop

git clone https://github.com/siewertserau/Examples-RAID-Unit-Test.gitYou need my permission to push changes back, but anyone can pull

Sam Siewert 5

Page 6: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

GitHub New ProjectCreate Your Own SE420 Student ProjectStart GitHub Desktop, Download Code from Web, Drag Folder over to Create new repositoryPublish for Use by Others [on your team, public]Push to GitHub so Others can Clone on Your Team [Pull]

Sam Siewert 6

#1

#2#3

Page 7: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

University MachinesI Requested Git client for Cloning and CMVC on EE Servers

See Cloning Path on GitHub Desktop / Web – View on GitHub – Use SSH or HTTPS to Clone [SSH is Preferred]

Sam Siewert 7

Grab clone path here

Clone to Desktop here

Get Archive here

Page 8: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Example Use of Git for CMVC

Simple RAID Code Example at ERAU

Sam Siewert

8

Page 9: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Git Example – Use SSH TunnelSet up your SSH key on PRClab and copy it to your key-ring on GitHub (described here too -https://help.github.com/articles/generating-ssh-keys/ ):– ssh-keygen -t rsa -C [email protected] [follow prompts as described on

web page above]– ssh-agent –s [start ssh agent for your current login – do this on each login]– cat ~/.ssh/id_rsa.pub [copy the output that should be something like “ssh-

rsa ****************** [email protected]”, where ****’s are my encrypted key, so your’s will be unique and different

– got to github.com/siewertserau [replace with your github username]– Go to “gear” configuration tool and add your SSH key, here:

Sam Siewert 9

note that I have erased portions of my keys for security

Page 10: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Git Example – SSH CloningNow that you have your SSH key generated on PRClab on your GitHub keyring, you can clone with SSH instead of the HTTPS clone– Now, for me, I just copied from the web page

and then issued the clone command on PRClab “git clone [email protected]:siewertserau/Examples-Imageproc-Unit-Test.git” and I’m prompted for my SSH passphrase now, which is great, and if I enter it correctly, I will get an SSH clone sandbox.

– It should look like this:

Sam Siewert 10

Use SSH PATH

Page 11: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Git Example – Sandbox WorkNow edit your files, add files, build, test and when your happy, do “git add *” to add any new files you copied into your sandbox, and do a pull to make sure you are current.

Now do “git commit –a” to commit the change set to your clone sandbox and add a meaningful comment and after do “git push”, which should look like:

Sam Siewert 11

Page 12: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Git Example – Browse Change HistoryUse Browse code and Side-by-side “Split” view to Compare Old and New Versions of a fileBrowsing Code Change History is One of the MOST Powerful Features of CMVC

Sam Siewert 12

Page 13: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Binary File ExampleMake changes, build, test and then commit and push

Now Run to Generate Chunk files

Sam Siewert 13

Page 14: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Git RAID Example - BrowseTo See What I Changed, BrowseFirst, 4 New “+” Lines for Includes for Simple file I/ONext, 2 New Lines to Declare Simple file Descriptors

Sam Siewert 14

Page 15: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Git RAID Example – Test Case UpdateNew Block of Binary Output for External VerificationCan “diff” and use “od –t x1” on files to Examine

Sam Siewert 15

Line 129 to 158 is NewLine 124 and 160 Sync Up Again

Page 16: CMVC - Using Git to Manage Source Code & Configurationmercury.pr.erau.edu/~siewerts/...on-Git-for-CMVC.pdfGit Example – Sandbox Work Now edit your files, add files, build, test and

Basic Binary File Dump and CompareChunk1.bin, …, Chunk4.bin are Data Files in 4+1 RAID-5 Set

ChunkXOR.bin is the XOR Parity File in the RAID-5 4+1

Chunk4_Rebuilt.bin is the Recovered Data in Test Case #0

Identical Chunks, so XOR=0 Sam Siewert 16