EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

Similar documents
EECS 470 Lab 4. Version Control System. Thursday, 27 th September, 2018

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

Version Control with GIT

FEEG Applied Programming 3 - Version Control and Git II

Git Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : October, More documents are freely available at PythonDSP

Revision control. INF5750/ Lecture 2 (Part I)

Introduction to Git and Github

2 Initialize a git repository on your machine, add a README file, commit and push

Revision Control and GIT

Git. Presenter: Haotao (Eric) Lai Contact:

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Git for Newbies. ComMouse Dongyue Studio

Version Control System - Git. zswu


CSE 391 Lecture 9. Version control with Git

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command:

Introduction to distributed version control with git

Git for Version Control

Windows. Everywhere else

Submitting your Work using GIT

So#ware(Project. Lecture'4. Wouter'Swierstra. So#ware(project( (Lecture(4 1

Version control with Git.

Software Project (Lecture 4): Git & Github

A Brief Introduction to Git. Sylverie Herbert (based on slides by Hautahi Kingi)

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

Index. Alias syntax, 31 Author and commit attributes, 334

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

Computer Science Design I Version Control with Git

Version Control System GIT

213/513/613 Linux/Git Bootcamp. Cyrus, Eugene, Minji, Niko

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

Version Control Systems

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

Using Git to Manage Source RTL

Effective Programming Practices for Economists. 7. Version Control, Part II: Git with a Shared Repository

Chapter 5. Version Control: Git

Git, the magical version control

Git Tutorial. Version: 0.2. Anders Nilsson April 1, 2014

History...: Displays a window of Gitk, a standard commit viewer for Git.

Eugene, Niko, Matt, and Oliver

Object Oriented Programming. Week 1 Part 2 Git and egit

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Gerrit

Git. CSCI 5828: Foundations of Software Engineering Lecture 02a 08/27/2015

Git: Distributed Version Control

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum

Effective Software Development and Version Control

Version Control: Gitting Started

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

A quick (and maybe practical) guide to Git and version control. By Jay Johnson

GIT tutorial. David Parsons, Soraya Arias, Thomas Calmant November, Preamble 2

CS314 Software Engineering Configuration Management

Use git rm to remove files from workspace

Git! Fundamentals. IT Pro Roundtable! June 17, 2014!! Justin Elliott! ITS / TLT! Classroom and Lab Computing!! Michael Potter!

GIT. A free and open source distributed version control system. User Guide. January, Department of Computer Science and Engineering

Lecture 6 Remotes. Sign in on the attendance sheet!

git the SCM system Jan-Simon Möller training.linuxfoundation.org

Fundamentals of Git 1

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

GUIDE TO MAKE A REAL CONTRIBUTION TO AN OPEN SOURCE PROJECT 1. 1

Introduction to Git. Let us list below some of the best known and most widely used version control systems:

Assumptions. GIT Commands. OS Commands

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Version Control with Git ME 461 Fall 2018

Git tutorial. Katie Osterried C2SM. October 22, 2015

License. Introduction to Version Control with Git. Local Version Control Systems. Why Use Version Control?

6 Git & Modularization

CS 390 Software Engineering Lecture 5 More Git

Tools for software development:

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng

Git version control with Eclipse (EGit) Tutorial

How to be a git. Dominic Mitchell

Improving Your Life With Git

GETTING TO KNOW GIT: PART II JUSTIN ELLIOTT PENN STATE UNIVERSITY

Tutorial: Getting Started with Git. Introduction to version control Benefits of using Git Basic commands Workflow

Version control system (VCS)

DEAD-SIMPLE VERSION CONTROL FOR YOUR TEAM GIT WITH MATTHEW REIDSMA GRAND VALLEY STATE UNIVERSITY

Git: Distributed Version Control

Outline. Version Control System (VCS) basics Git terminology & concepts Basic Git commands Branches in Git Git over the network (time permitting)

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

What is Secure. Authenticated I know who I am talking to. Our communication is Encrypted

Code and data management with Git

Lab Exercise Git: A distributed version control system

The Intro. Aaron Bartell Director of IBM i Innovation. Copyright 2015 Aaron Bartell

Version control CSE 403

Gitting things done. Hands-on introduction to git niceties. Jan Urbański Ducksboard

CSE 344: Section 1 Git Setup for HW Introduction to SQLite. September 28, 2017

Version Control. Software Carpentry Github s Hello World Git For Ages 4 And Up You need source code control now

What is git? Distributed Version Control System (VCS); Created by Linus Torvalds, to help with Linux development;

DEVNET Introduction to Git. Ashley Roach Principal Engineer Evangelist

VCS VERSION CONTROL SYSTEMS

From Commits to Collaboration: A Git Tutorial for Social Scientists

Git Introduction CS 400. February 11, 2018

John DeDourek Professor Emeritus Faculty of Computer Science University of New Brunswick GIT

Using Git For Development. Shantanu Pavgi, UAB IT Research Computing

EECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018

Transcription:

EECS 470 Lab 4 Version Control System Department of Electrical Engineering and Computer Science College of Engineering University of Michigan Friday, 31 st January, 2014 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 1 / 62

Overview Administrivia Git VCS Basics Distributed VCS Git Preliminaries Assignment (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 2 / 62

Administrivia Administrivia Homework Homework 2 is due Monday, 3 rd February at the beginning of lecture If you haven t, you need to get started now Projects Project 3 is due Sunday, 9 th February at 9:00PM We are available to answer questions on anything here. Office hours can be found in the course google calendar. (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 3 / 62

VCS Basics Version Control Systems What is a version control system? Stores text files Keeps old versions around Allows parallel work Why do I care? Prevents/helps prevent loss of data (nothing is foolproof) Great for group work Required for Project 3 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 4 / 62

VCS Basics History of VCS Motivation Avoid having isr.v.old isr.v.old2 isr.v.working isr.v.really_working A Short History 1950 Manual file naming 1982 Revision Control System Local 1986 Concurrent Versions System 2000 Subversion Central 2005 Git Distributed (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 5 / 62

Distributed VCS Centralized VCS What does it mean to be centralized? Clients talk to a server, which is the one, true version Server copy keeps history Clients have a(n) (incomplete) working copy (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 7 / 62

Distributed VCS Distributed VCS VCS Structure Centralized (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 8 / 62

Distributed VCS Distributed VCS What does it mean to be distributed? Every copy is created equal (can all act as the server) No one, true version (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 9 / 62

Distributed VCS Distributed VCS VCS Structure Distributed (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 10 / 62

Distributed VCS Hybrid VCS The Hybrid Approach Use a DVCS Set up a server to be the synchronization point Possibly still connect directly to colleagues, but generally not (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 11 / 62

Distributed VCS Distributed VCS VCS Structure Hybrid (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 12 / 62

Git Preliminaries Subsection 3 Git Preliminaries (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 13 / 62

Git Preliminaries Secure Shell What is ssh? Secured remote connection to a server, e.g. Remote shell How git (should) communicate(s) with other machines What do I need to know? Requires that you identify yourself: Key (RSA or DSA) Password (keyboard-interactive) Kerberos (gssapi-with-mic) Necessary for Bitbucket (coming up) (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 14 / 62

Git Preliminaries Secure Shell: Keys SSH Keys Public-private key pair authentication Can also be password protected ssh-keygen Creates /.ssh/id_rsa (your private key) and /.ssh/id_rsa.pub (your public key) (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 15 / 62

Git Preliminaries Example: ssh-keygen [wcunning@dahak ~] $ ssh-keygen -t rsa -b 4096 Generating public/private rsa key pair. Enter file in which to save the key (/home/wcunning/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/wcunning/.ssh/id_rsa. Your public key has been saved in /home/wcunning/.ssh/id_rsa.pub. The key fingerprint is: 3f:91:f9:7f:d7:be:4e:62:56:27:88:1d:3a:5d:b4:56 wcunning@dahak The key's randomart image is: +--[ RSA 4096]----+. E. o. + B = S B +.... +... o.+...o.o + o=+ +-----------------+ (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 16 / 62

Git Preliminaries Git Configuration Follow Along Run the following commands: git config --global user.name Your Name git config --global user.email uniqname@umich.edu Optionally: Download wcunning-dotfiles.tar.gz Open it up Copy.gitconfig and.gitignore to your home directory Optionally copy other configs/google those programs (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 17 / 62

Git Preliminaries Bitbucket What is Bitbucket? Free, online git repositories More friendly to private repos than Github What do I need to know? Used for Project 3 and the final project You need to make an account, right now Once you have an account, add it to this spreadsheet How to make a Bitbucket account... (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 18 / 62

Example Execution [wcunning@dahak ~] $ git clone git@bitbucket.org:eecs470staff/course_material.git Cloning into 'course_material'... Warning: Permanently added the RSA host key for IP address '131.103.20.168' to the list of known hosts. remote: Counting objects: 183, done. remote: Compressing objects: 100% (166/166), done. remote: Total 183 (delta 39), reused 0 (delta 0) Receiving objects: 100% (183/183), 141.58 KiB 0 bytes/s, done. Resolving deltas: 100% (39/39), done. Checking connectivity... done [wcunning@dahak Documents] $ cd course_material/ [wcunning@dahak project1] [master] $ vim projects/project1/testd.v [wcunning@dahak project1] [master *] $ git add projects/project1/testd.v [wcunning@dahak project1] [master +] $ git commit [master 4caae96] Updated Project 1 to use @(posedge clock); 1 file changed, 11 insertions(+), 11 deletions(-) [wcunning@dahak project1] [master] $ git push Counting objects: 10, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 544 bytes 0 bytes/s, done. Total 5 (delta 3), reused 0 (delta 0) To git@bitbucket.org:eecs470staff/course_material.git da0cf7a..4caae96 master -> master (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 19 / 62

Git Basics Introduction Structure For each command you need to know, we will 1. Occasionally, an aside with a Git Concept we need to describe a command 2. Describe the command, along with any useful flags/options 3. Show how the command affects the repositories 4. Show an example with output (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 20 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=9a12490 Mark HEAD=9a12490 Will HEAD=9a12490 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 21 / 62

Git Commands: clone What does git clone do? Makes a copy of a repository Syntax and Options Example: git clone <protocol>:/<repo> <directory> Clones the repo at <repo> into <directory> Repos can be accessed through several different protocols Git: Unsecured, do not use HTTP(S): Used for freely available things, but push should use the secured version SSH: The right answer, always secure, likely passwordless (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 22 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=9a12490 Mark HEAD=9a12490 Jon HEAD=9a12490 Will HEAD=9a12490 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 23 / 62

Git Commands by Example: clone [jbbeau@dahak ~] $ git clone git@bitbucket.org:eecs470staff/course_material.git Cloning into '.'... remote: Counting objects: 79, done. remote: Compressing objects: 100% (68/68), done. remote: Total 79 (delta 13), reused 0 (delta 0) Receiving objects: 100% (79/79), 79.99 KiB, done. Resolving deltas: 100% (13/13), done. (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 24 / 62

Git Concepts: Working Copy vs. Local Repo What is the working copy? The files/folders you actually operate on e.g. group1/ What is the local repo? The hidden folder containing the stored history for the repo e.g. group1/.git/ Consequences.git/ directory is a full repo Useful in the event that you needed a backup Commits get stored here Synchronization with the remote is explicit (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 25 / 62

Git Concepts: Remotes What is a remote? Remotes are bookmarked repositories to synchronize with Consequences Clone automatically creates a remote named origin, which is the default for all remote operations (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 26 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=9a12490 Mark HEAD=9a12490 Jon* HEAD=9a12490 Will HEAD=9a12490 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 27 / 62

Git Concepts: Tracked Files What does it mean for a file to be tracked? Files that are tracked are stored in the repository Consequences Untracked files have no history Tracked files can be compared for changes Files can be ignored (.gitignore) (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 28 / 62

Git Commands: status What does git status do? Shows the contents of the staging area Shows the files with differences to the most recent commit Shows the files untracked by git Syntax and Options Example: git status (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 29 / 62

Git Commands by Example: status [jbbeau@dahak slides] [master *] $ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: eecs470lab4slides.tex # (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 30 / 62

Git Commands: add What does git add do? If a file is untracked it becomes tracked Otherwise, the current version is taken as a snapshot and added to the staging area Syntax and Options Example: git add <files> <files> can be any normal shell file structure (globs, wildcards, directories, etc.) if <files> has a directory, it is added recursively git add interactive: Lets you add files and parts of files from the status output interactively; possibly good for commit building after a complex set of changes (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 31 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=9a12490 Mark HEAD=9a12490 Jon+ HEAD=9a12490 Will HEAD=9a12490 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 32 / 62

Git Commands by Example: add [jbbeau@dahak slides] [master *] $ git add eecs470lab4slides.tex [jbbeau@dahak slides] [master +] $ git status # On branch master # Changes to be committed: # (use git reset HEAD <file>..." to unstage # # modified: eecs470lab4slides.tex # (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 33 / 62

Git Concepts: Snapshots What is a snapshot? git add doesn t follow a file in perpetuity Instead, it saves a snapshot (the state of the file at the time the command was called) Consequences Files need to be added every time they are changed Can add only certain files to a commit (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 34 / 62

Git Concepts: The Staging Area What is the staging area? Contains the snapshots to be used in creating the next commit Consequences Commits can be built thematically Commits can be relatively small, even if changes to be committed are large (useful for git bisect) (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 35 / 62

Git Commands: commit What does git commit do? Combines everything in the staging area into a commit, described by your log message Adds it all to the local repo Points at it with a commit hash Changes HEAD to point at that commit hash Syntax and Options Example: git commit Interesting things are possible with commit hooks (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 36 / 62

Git Ettiquette: Commits What is a good commit? Informative message short one liner followed by thorough paragraphs describing all of the changes Thematic all of the changes should go together logically (e.g. added a module and integrated it) Small keeping your changes small makes it easier to find what broke everything by binary searching the commit history (bisect) Why? All of these rules make it easier to find bugs and understand the progression of a project Most are mandatory at companies (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 37 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=9a12490 Mark HEAD=9a12490 Jon Will HEAD=9a12490 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 38 / 62

Git Commands by Example: commit [jbbeau@dahak slides] [master +] $ git commit [master f2ea0f5] Lab 4 diagram change 1 file changed, 1 insertion(+), 1 deletion(-) (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 39 / 62

Git Commands: push What does git push do? Puts all of your local commits on some remote Syntax and Options Example: git push Defaults to pushing the master branch to the origin repo Interesting things are possible with push hooks (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 40 / 62

Git Diagram Git Repo Structure Commit Tree [origin] Mark HEAD=9a12490 Jon Will HEAD=9a12490 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 41 / 62

Git Commands by Example: push [jbbeau@dahak slides] [master] $ git push Counting objects: 11, done. Delta compression using up to 8 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (6/6), 475 bytes 0 bytes/s, done. Total 6 (delta 3), reused 0 (delta 0) To git@bitbucket.org:eecs470staff/course_material.git 9a12490..f2ea0f5 master -> master (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 42 / 62

Git Commands: pull What does git pull do? Gets all commits from some remote This is actually a combination of git fetch followed by git merge Syntax and Options Example: git pull Defaults to pulling the master branch from the origin repo (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 43 / 62

Git Diagram Git Repo Structure Commit Tree [origin] Mark Jon Will f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 44 / 62

Git Commands by Example: pull [wcunning@mycroft-holmes course_material] [master] $ git pull remote: Counting objects: 13, done. remote: Compressing objects: 100% (7/7), done. remote: Total 8 (delta 2), reused 0 (delta 0) Unpacking objects: 100% (8/8), done. From bitbucket.org:eecs470staff/course_material 9a12490..f2ea0f5 master -> origin/master (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 45 / 62

Git Diagram Git Repo Structure Commit Tree [origin] Mark Jon Will* f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 46 / 62

Git Commands: reset What does git reset do? Replaces modified files in the working directory with the versions in the local repo (at some commit hash, generally) Syntax and Options Example: git reset <hash> <file> Replaces the contents of <file> with the version in <hash> <hash> can be specified in relation the HEAD (e.g. HEAD 3) (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 47 / 62

Git Diagram Git Repo Structure Commit Tree [origin] Mark Jon Will f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 48 / 62

Git Commands by Example: reset [wcunning@mycroft-holmes slides] [master *] $ git status # On branch master # Changes not staged for commit: # (use "git add/rm <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # deleted: beamerthemelab.sty # no changes added to commit (use "git add" and/or "git commit -a") [wcunning@mycroft-holmes slides] [master *] $ git reset --hard HEAD is now at f2ea0f5 Lab 4 diagram change (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 49 / 62

Git Commands: branch What does git branch do? Creates a pointer to a particular commit hash, future commits update this pointer Syntax and Options Example: git branch <branchname> Creates a branch named <branchname> starting at the current HEAD (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 50 / 62

Git Commands: checkout What does git checkout do? Moves the working directory to the specified commit hash or pointer to a commit hash Syntax and Options Example: git checkout <hash> <hash> can be an older commit (e.g. HEAD 2) a branch, or other pointer, (e.g. lab4) (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 51 / 62

Git Diagram Git Repo Structure Commit Tree [origin] Mark Jon Will f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 52 / 62

Git Commands by Example: branch, checkout [wcunning@mycroft-holmes slides] [master] $ git branch lab4 [wcunning@mycroft-holmes slides] [master] $ git status On branch master Your branch is up-to-date with 'origin/master'. [wcunning@mycroft-holmes slides] [master] $ git checkout lab4 Switched to branch 'lab4' (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 53 / 62

Git Diagram Git Repo Structure Commit Tree [origin] Mark Jon Will* f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] Mark Jon Will+ f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] 8e4bab6 Mark Jon Will HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] 8e4bab6 Mark* Jon Will HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] 8e4bab6 Mark+ Jon Will HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] 8e4bab6 b73416d Mark HEAD=b73416d Jon Will HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] 8e4bab6 b73416d Mark* HEAD=b73416d Jon Will HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] 8e4bab6 b73416d Mark+ HEAD=b73416d Jon Will HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] 4b3d3cb 8e4bab6 b73416d Mark HEAD=4b3d3cb Jon Will HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=4b3d3cb 4b3d3cb 8e4bab6 b73416d Mark HEAD=4b3d3cb Jon Will HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=4b3d3cb 4b3d3cb 8e4bab6 b73416d Mark HEAD=4b3d3cb Jon Will* HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=4b3d3cb 4b3d3cb 8e4bab6 b73416d Mark HEAD=4b3d3cb Jon Will+ HEAD=8e4bab6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=4b3d3cb 06505f6 4b3d3cb 8e4bab6 b73416d Mark HEAD=4b3d3cb Jon Will HEAD=06505f6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Diagram Git Repo Structure Commit Tree [origin] HEAD=4b3d3cb 06505f6 4b3d3cb 8e4bab6 b73416d Mark HEAD=4b3d3cb Jon Will HEAD=06505f6 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 54 / 62

Git Commands: merge What does git merge do? Combines two branches (when used manually) Can mangle a repository Can have conflicts Syntax and Options Example: git merge lab4 Merges the lab4 branch into the current branch git mergetool helps you handle merge conflicts See me in office hours if you need to do this... (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 55 / 62

Git Diagram Git Repo Structure Commit Tree a292319 [origin] HEAD=4b3d3cb 06505f6 4b3d3cb 8e4bab6 b73416d Mark HEAD=4b3d3cb Jon Will HEAD=a292319 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 56 / 62

Git Commands by Example: merge [wcunning@mycroft-holmes slides] [master $] $ git merge lab4 Updating f2ea0f5..25cbbce Fast-forward.gitignore 68 +++++++ labs/lab4/assignment/tex/eecs470lab4assignment.tex 2 +- labs/lab4/slides/eecs470lab4slides.tex 613 ++++++++++++++++++++ labs/lab4/slides/script.txt 148 ++++++++++++++ labs/lab4/slides/ssh-keygen.txt 21 ++ 5 files changed, 841 insertions(+), 11 deletions(-) create mode 100644.gitignore create mode 100644 labs/lab4/slides/script.txt create mode 100644 labs/lab4/slides/ssh-keygen.txt (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 57 / 62

Git Commands: tag What does git tag do? Creates an additional pointer to a particular commit hash Syntax and Options Example: git tag -a <tagname> <hash> Creates a pointer to <hash> called <tagname> This pointer can be checked out just like a branch Tags are local by default, push with git push <tagname> (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 58 / 62

Git Diagram Git Repo Structure Commit Tree lab4 a292319 [origin] HEAD=4b3d3cb 06505f6 4b3d3cb 8e4bab6 b73416d Mark HEAD=4b3d3cb Jon Will HEAD=a292319 f2ea0f5 9a12490 (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 59 / 62

Git Commands by Example: merge [wcunning@mycroft-holmes w14] [master] $ git tag -a lab4-release HEAD [wcunning@mycroft-holmes w14] [master] $ git push origin lab4-release Counting objects: 1, done. Writing objects: 100% (1/1), 187 bytes 0 bytes/s, done. Total 1 (delta 0), reused 0 (delta 0) To git@bitbucket.org:eecs470staff/course_material.git * [new tag] lab4-release -> lab4-release [wcunning@mycroft-holmes w14] [master] $ git tag -l lab4-release (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 60 / 62

Assignment Lab Assignment Assignment is posted to the course website as Lab 4 Assignment. If you get stuck... Ask a neighbor, quietly Put yourself in the help queue Note: Unlike most labs, to get checked off for this one, you will also need to have made your Bitbucket account and entered it in the spreadsheet. When you finish the assignment, sign up in the help queue and mark that you would like to be checked off. If you are unable to finish today, the assignment needs to be checked off by a GSI in office hours before the next lab session. (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 61 / 62

Bitbucket Guide Bitbucket Account Setup 1. Go to Bitbucket Sign Up 2. Fill out the form. Preferably, use your uniqname as your username Use your @umich.edu email address Choose Personal Account 3. Click on the little silhouette of a person in the upper right corner. 4. Select Manage Account from the list. 5. Click on SSH Keys in the list on the left. 6. Click on Add Key. 7. In the pop up, paste the contents of /.ssh/id_rsa.pub, and name the key whatever you would like. 8. Add your Bitbucket username to the spreadsheet. (University of Michigan) Lab 4: VCS Friday, 31 st January, 2014 62 / 62