CS 2112 Lab: Version Control



Similar documents
Using Git for Project Management with µvision

Git Basics. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 22

Derived from Chris Cannam's original at, an.

Command Line - Part 1

Source Control Systems

MATLAB & Git Versioning: The Very Basics

Version Control with Subversion and Xcode

Version control with Subversion

Version Control Using Subversion. Version Control Using Subversion 1 / 27

Version Control with Subversion

pure::variants Transformer for Software Configuration Management Manual

ICS 351: Today's plan

Version Control! Scenarios, Working with Git!

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

Version Control with. Ben Morgan

Unix Guide. Logo Reproduction. School of Computing & Information Systems. Colours red and black on white backgroun

Software configuration management

Work. MATLAB Source Control Using Git

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

pure::variants Connector for Version Control Systems Manual

Version Control for Computational Economists: An Introduction

Version Control with Git. Dylan Nugent

Git, GitHub & Web Hosting Workshop

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

Version Uncontrolled! : How to Manage Your Version Control

Data management on HPC platforms

Linux Overview. Local facilities. Linux commands. The vi (gvim) editor

Version Control Tutorial using TortoiseSVN and. TortoiseGit

Version control. HEAD is the name of the latest revision in the repository. It can be used in subversion rather than the latest revision number.

Revision control systems (RCS) and

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

RECOVER ( 8 ) Maintenance Procedures RECOVER ( 8 )

A Crash Course on UNIX

Source Control Guide: Git

An Introduction to Mercurial Version Control Software

Advanced Computing Tools for Applied Research Chapter 4. Version control

Software Configuration Management. Slides derived from Dr. Sara Stoecklin s notes and various web sources.

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Fundamentals of UNIX Lab Networking Commands (Estimated time: 45 min.)

There s a variety of software that can be used, but the approach described here uses freely available Cygwin software: (1) Cygwin/X (2) Cygwin/openssh

Extending Remote Desktop for Large Installations. Distributed Package Installs

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

Command Line Crash Course For Unix

Version Control. Version Control

Version Control with Git

Unix Sampler. PEOPLE whoami id who

Version Control Systems: SVN and GIT. How do VCS support SW development teams?

University of Toronto

Version Control with Git. Kate Hedstrom ARSC, UAF

Linux command line. An introduction to the Linux command line for genomics. Susan Fairley

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

Version Control with Subversion

The Hitchhiker s Guide to Github: SAS Programming Goes Social Jiangtang Hu d-wise Technologies, Inc., Morrisville, NC

FEEG Applied Programming 3 - Version Control and Git II

Surround SCM Best Practices

Continuous Integration

Lab Exercise Part II: Git: A distributed version control system

In depth study - Dev teams tooling

Version control tracks multiple versions. Configuration Management. Version Control. V Software Engineering Lecture 12, Spring 2008

CONNECTING TO DEPARTMENT OF COMPUTER SCIENCE SERVERS BOTH FROM ON AND OFF CAMPUS USING TUNNELING, PuTTY, AND VNC Client Utilities

Using SVN to Manage Source RTL

Version Control Using Subversion. 12 May 2013 OSU CSE 1

Intro etckeeper bup ikiwiki git-annex vcsh mr Zsh Outro. Gitify your life. web, blog, configs, data, and backups

UNIX Basics. Ian Darwin TCP Informatics January, Presented from a Mac using Apple s Keynote presentation software

Zero-Touch Drupal Deployment

Continuous Integration. CSC 440: Software Engineering Slide #1

Version control with GIT

AN INTRODUCTION TO UNIX

CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

Content. Development Tools 2(63)

Git Basics. Christian Hanser. Institute for Applied Information Processing and Communications Graz University of Technology. 6.

INF 111 / CSE 121. Homework 4: Subversion Due Tuesday, July 14, 2009

Using SVN to Manage Source RTL

Source Code Management/Version Control

Command-Line Operations : The Shell. Don't fear the command line...

Distributed Version Control

Shellshock Security Patch for X86

Getting Started with Command Prompts

The Einstein Depot server

embeo Getting Started and Samples

MOOSE-Based Application Development on GitLab

An Introduction to Mercurial Version Control Software

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, Introduction 1. 2 Invoking Shell Scripts 2

Introducing Xcode Source Control

1. History 2. Structure 3. Git Comparison 4. File Storage 5. File Tracking 6. Staging 7. Queues (MQ) 8. Merge Tools 9. Interfaces

Module 11 Setting up Customization Environment

An Introduction to Git Version Control for SAS Programmers

Distributed Version Control with Mercurial and git

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

Version Control Script

Version Control using Git and Github. Joseph Rivera

Introduc)on to Version Control with Git. Pradeep Sivakumar, PhD Sr. Computa5onal Specialist Research Compu5ng, NUIT

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

1 Basic commands. 2 Terminology. CS61B, Fall 2009 Simple UNIX Commands P. N. Hilfinger

Transcription:

29 September 1 October, 2014

Version Control What is Version Control? You re emailing your project back and forth with your partner. An hour before the deadline, you and your partner both find different bugs and work feverishly to correct them. When you try to submit, you find that you have two different versions of the code, and you don t have enough time to figure out who changed what, how to merge them together into one final project, and what, if any, bugs were introduced along the way!

Version Control What is Version Control? Version control allows multiple people to work on a project simultaneously by keeping versioned copies of each file in your project for each edit that you make. This makes it easy to: Revert files back to a previous state if you make a mistake. Look over any changes made by you or those you are working with. Recover any files if they are lost. Distributed version control lets you store the different versions of your files on a remote server.

Overview Git! Several widely used version control systems exist. Some of the most popular free ones are Git, Mercurial, and Subversion. Perforce is often used in industry. We will take a look at Git, which is popular, freely available, and powerful. Subversion is simpler to use but less powerful; Mercurial is similar to Git; perhaps a little slower. Eclipse has some support for projects that use Git, but it s safer to get Git at the command line.

Overview Setting Up a Repository A couple of sites host free repositories, including: github.com (Git - though you will need to request a student account for private repositories) bitbucket.org (Git and Mercurial) xp-dev.com (Subversion, Git, and Mercurial) You will need to follow the specific instructions for whichever host you choose in order to initialize a Git project and add your new remote repository. (This will make more sense later!)

Structure The Local Repository Your local repository contains 3 trees: Working Directory - This is where you will look at, modify, and add files to your project. Staging Area/Index - When you add a file (git add file from the command line, or Add to Index in Eclipse), the file is added to this second tree, the staging area. This is where you prepare the files that you would like to eventually commit to your repository. Repository - When you commit the changes made to your files (git commit by command line, Commit in Eclipse), changes made to the files in your staging area are added to the repository as new versions of those files. You must specify a commit message with each commit to let others know what you have changed.

Structure The Local Repository Figure: Local Repository Workflow

Structure The Remote Repository When you are ready for others on your team to be able to view and pull your changes into their own local repositories, you can push your committed changes to the remote repository. If anyone else has pushed changes to your remote repository, Git will make you pull those changes into your own local repository before pushing any new changes. If you and your partner have been working on different parts of your code, Git will automatically merge in your partner s changes smoothly. If you have been working on the same code, however...

Structure The Remote Repository Figure: Remote repository workflow

Conflicts and Reverting Merge conflicts If you and your partner have both modified the same code, Git will be unsure about which version you would like it to use - yours, or theirs? To fix this, Git will ask you to resolve merge conflicts. Figure: Eclipse Merge Conflict Tool

Conflicts and Reverting Merge conflicts Once you have your Local File Workspace version of the file looking how you would like, you can right click on the file to mark it as merged. You can then commit your merge, and push it as normal.

Conflicts and Reverting Git Workflow - Reverting a File Figure: A Git Workflow

Conflicts and Reverting EGit Commands to Remember! Team Add to Index Add a file to your Index if you want to track the changes you make in it, and commit those changes later. Team Commit Commit changes in your working directory to your local repository; these changes will be pushed to the remote repository on the next Push command. Team Synchronize Workspace This will pull from the remote repository and make sure that your local repository is up to date (needed especially before a Push) Push or Team Push Branch Pushes all your committed changes to the remote repository

The shell: a lower-level interface A shell is a command-line interface to your computer s operating system. Less pretty than the GUI interface, more functional. Windows: cmd, Cygwin (Unix on Windows), or PowerShell Unix (Mac OS X, Linux): sh (bash), (t)csh

Shell commands A shell command consists of a program name followed by some optiona command-line arguments. Spaces separate the command and the arguments from each other. Examples: rm filename (Windows: del filename ) : remove a file ls directory (Windows: dir directory ): list contents of directory echo message : print the message to standard output cat filename (Windows: type filename ) : print the contents of the file. cd directory : change the current directory (shell built-in command)

Command context Every command is executed with some context provided by the operating system: The current directory in which the command runs. All files accesses are relative to this directory. Note: folders are known as directories at the operating system level. A set of environment variables that can be looked up by the running program. 1 Standard input and output devices. Normally standard input reads from the shell s input and output goes to the shell. However, it is possible to override these. The syntax > filename redirects output to the specified file. 1 The ShellShock vulnerability exploits a bug in how the bash shell handles environment variables.

Pathnames and directories Files and directories are specified by pathnames: names separated by slashes (Unix, Cygwin) or backslashes (Windows). Pathnames starting with a slash (backslash) are absolute and start from the root of the file system. The special directory. means the current directory, and.. means the parent directory of the current directory. To go up a directory: cd.. To go to the root directory: cd / To list the current directory: ls., or just ls.