Version Control. Version Control

Similar documents
Version Control. Version Control

A BASIC UNDERSTANDING OF VERSION CONTROL

CS 390 Software Engineering Lecture 5 More Git

Revision Control. An Introduction Using Git 1/15

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

Git tutorial. Katie Osterried C2SM. October 22, 2015

Topics covered. Introduction to Git Git workflows Git key concepts Hands on session Branching models. Git 2

Version Control: Gitting Started

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

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

Tools for software development:

CS314 Software Engineering Configuration Management

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

Version Control Systems

Software Revision Control for MASS. Git Installation / Configuration / Use

Introduction to Version Control

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

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

Windows. Everywhere else

Assumptions. GIT Commands. OS Commands

Fundamentals of Git 1

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

Getting the files for the first time...2. Making Changes, Commiting them and Pull Requests:...5. Update your repository from the upstream master...

Revision control. INF5750/ Lecture 2 (Part I)

Version Control Systems (VCS)

CS 320 Introduction to Software Engineering Spring February 06, 2017

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

Version Control with Git ME 461 Fall 2018

Computer Science Design I Version Control with Git

Version control with Git.

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

Algorithm Engineering

Revision Control and GIT

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

Introduction to distributed version control with git

How to version control like a pro: a roadmap to your reproducible & collaborative research

Object Oriented Programming. Week 1 Part 2 Git and egit

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

G E T T I N G S TA R T E D W I T H G I T

Version Control System - Git. zswu

M E R C U R I A L (The Source Control Management)

Introduction to Git and Github

Version control system (VCS)

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

Lab Exercise Git: A distributed version control system

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

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

Introduction to Version Control with Git

Git for Version Control

Git. SSE2034: System Software Experiment 3, Fall 2018, Jinkyu Jeong

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

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

Git for Newbies. ComMouse Dongyue Studio

b. Developing multiple versions of a software project in parallel

CSE 391 Lecture 9. Version control with Git

Git & Github Fundamental by Rajesh Kumar.

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

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

CS 390 Software Engineering Lecture 4 - Git

Tizen/Artik IoT Practice Part 4 Open Source Development

! #Running this command from the top directory of your project will add all your changes."! $ git add."

Lecture 6 Remotes. Sign in on the attendance sheet!

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

L Modeling and Simulating Social Systems with MATLAB

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Outline The three W s Overview of gits structure Using git Final stuff. Git. A fast distributed revision control system

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

GIT Princípy tvorby softvéru, FMFI UK Jana Kostičová,

FAQ Q: Where/in which branch do I create new code/modify existing code? A: Q: How do I commit new changes? A:


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

Version Control with Git

Version Control with GIT

AIS Grid School 2015

Git Introduction CS 400. February 11, 2018

FEEG Applied Programming 3 - Version Control and Git II

Version control. what is version control? setting up Git simple command-line usage Git basics

Version Control System GIT

Git. A fast distributed revision control system. Nils Moschüring PhD Student (LMU)

Version Control with Git

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

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

Git for Subversion users

Version control CSE 403

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

Git, the magical version control

CESSDA Expert Seminar 13 & 14 September 2016 Prague, Czech Republic

Software Development I

Creating a Patch. Created by Carl Heymann on 2010 Sep 14 1

February 2 nd Jean Parpaillon

Version control CSE 403

Git. Presenter: Haotao (Eric) Lai Contact:

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

Software Revision Control for MASS. Git Basics, Best Practices

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

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group

Visualizing Git Workflows. A visual guide to 539 workflows

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

Version Control Systems: Overview

1. Which of these Git client commands creates a copy of the repository and a working directory in the client s workspace. (Choose one.

Transcription:

Version Control CS440 Introduction to Software Engineering John Bell Based on slides prepared by Jason Leigh for CS 340 University of Illinois at Chicago Version Control Incredibly important when working in teams, or whenever multiple versions of a project need to be retained, recovered, and generally managed. Many tools for this: Revision Control System (RCS), Subversion (SVN), CVS, GIT etc. Ref: http://en.wikipedia.org/wiki/comparison_of_revi sion_control_software Pro Git online book: http://progit.org/book/ All CS 440 project teams will use git from a CS server: marvin.cs.uic.edu 1

How Previous Version Control Systems Worked E.g. SVN, Perforce, CVS Create a central repository for holding code. Upload initial codes to repository. Checkout codes to either read or modify. Edit codes. Commit edits to the repository. ( Check in ) Multiple users can checkout codes for reading, but only one at a time can checkout for editing. How Git Works Git is a distributed system. When you work on code as part of a group, you CLONE a remote repository. Git can also be used as a local repository system, for a single developer to archive multiple versions of a project. When you commit your changes you do not need to be networked to the repository server. You can push your updates later. I.e. you work with your local repository. Git has the notion of staging areas that are used to mark files that will get committed. This is really just the list of files that are monitored by git as part of a project. If you modify a file but do not stage it, it will not get committed. I.e. not all files in working directory are in git Git makes it very easy to create and switch code branches so you experiment with code ideas without damaging the main branch. 2

( control list ). Create / edit files git add git init create local project OR git clone create local copy Remote repository git commit git push copy back to origin Setup Git on Your Computer Go to: http://git-scm.com/ Download and install GIT for your platform. ( Right-click on directory and select git bash ) In Terminal Window: git config --global user.name John Bell git config --global user.email jbell@uic.edu ( These instructions are for using git via the command line. There are also interactive versions available. ) 3

Grab the Initial Git Repository Right click on parent directory where you want to work Select git bash to open a bash shell In Terminal Window: git clone groupname@marvin.cs.uic.edu:~/develop.git It will ask for a password- use the one provided. Repeat for Code.git ( or other repositories provided. ) This procedure will create twoa subdirectoriesy under the initial parent Code and Develop and configure themit for use with git. If the remote repositories are not empty, it will populate the directories with files from the repositories. ( I.e. It will set up working directories. ) NOTE: this is assuming you are using a remote repository. If instead you just want to create a git repository for yourself on your own computer, then you do: git init Add A New File Create the file you wish to add, e.g. overloading.cpp In Command Line Window: Let Git know: git add overloading.cpp Commit the file: git commit git will ask you for a comment. Use vi style editing commands Or use git commit -m message to use message as the commit comment. Push this file to the repository: git push origin master Origin refers to the remote repository Master refers to the master branch of your source code 4

Merging When multiple people have cloned a repository, made edits and now want to push their edits, git push will fail. You will need to: git fetch to get the new changes git merge origin/master then merge the two to form a wholly new master. Then finally: git push origin master See: http://progit.org/book/ch5-2.html Branching Lets say you want to experiment with a code idea and so you want to spin off a separate branch from the Master branch. You can use: git branch mynewbranch create the new branch git checkout mynewbranch switch to the branch From now on all mods to your code occur in the new branch. If you want to switch back to Master branch: git checkout master Now lets say you want to merge your codes with the changes your partner has made: git checkout master switch back to master branch git fetch fetch the remote mods git merge master merge with your master git merge mynewbranch if desired merge with mods in your special branch 5

Git In Depth Pro Git online book: HIGHLY RECOMMENDED http://progit.org/book/ Git Cheat Sheet git config set up git init do this if you plan to create your own local repository git clone from repository do this to bring in a remote repository git add files add files to staging area to mark for commit git commit commit the file git push origin master push the committed files to remote origin s master branch git log - show log of changes made to repository. git status - show current status of tracked files, e.g. uncommitted changes. Second person does git clone as well makes his changes tries to do push but fails must do a git fetch fetches latest updates from repository git merge merges the versions git pull does git fetch followed by git merge. git push origin master pushes it back to the server 6

Advice for using git git is best suited for projects in which different developers are working on different ( groups of ) files. It also works well for a single developer to keep track of multiple versions of his/her work, with either a local or remote repository. It is not as well suited for multiple authors collaborating on a single document. See the next slide for MS Word instructions. Using MS Word Collaboratively 1. All members of a team start with identical copies of a document, e.g. a first draft. 2. Each coauthor turns on track changes, on the Review tab of MS Word. 3. One editor collects all revised versions, and uses Review->Compare->Combine to merge the changes into one document. 4. Then the editor can step through all the proposed changes, and individually accept or reject each one. ( Does not require step 3. ) 7