Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.

Slides:



Advertisements
Similar presentations
Intro to Version Control Have you ever …? Had an application crash and lose ALL of your work Made changes to a file for the worse and wished you could.
Advertisements

Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
Git A distributed version control system 23-Aug-15.
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Version control Using Git 1Version control, using Git.
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
Version control with Github August 26th, 2014 Daniel Schreij VU Cognitive Psychology departement
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
Introduction to Version Control
With Mercurial and Progress.   Introduction  What is version control ?  Why use version control ?  Centralised vs. Distributed  Why Mercurial ?
Git – versioning and managing your software L. Grewe.
GIT An introduction to GIT Source Control. What is GIT (1 of 2) ▪ “Git is a free and open source distributed version control system designed to handle.
Version control Using Git Version control, using Git1.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Version Control. How do you share code? Discussion.
…using Git/Tortoise Git
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Introduction to Version Control with Git CSC/ECE 517, Fall 2014 A joint project of the CSC/ECE 517 staff, including Titus Barik, Gaurav Tungatkar, Govind.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
A Simple Introduction to Git: a distributed version-control system CS 5010 Program Design Paradigms “Bootcamp” Lesson 0.5 © Mitchell Wand, This.
Version Control System Lisa Palathingal 03/04/2015.
Intro to Git presented by Brian K. Vagnini Hosted by.
Version Control and SVN ECE 297. Why Do We Need Version Control?
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
CS 160 and CMPE/SE 131 Software Engineering February 16 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Technical Presentation by: David Spano. About Git (VCS) Simple Git Commands Branching Github Git GUI Summary.
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories.
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
Git workflows: using multiple branches for parallel development SE-2800 Dr. Mark L. Hornick 1.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
CS5220 Advanced Topics in Web Programming Version Control with Git
Information Systems and Network Engineering Laboratory II
Git and GitHub primer.
LECTURE 2: Software Configuration Management
Version Control.
Version control, using Git
CS5220 Advanced Topics in Web Programming Version Control with Git
Development and Deployment
Software Engineering for Data Scientists
Version Control with Git and GitHub
An introduction to version control systems with Git
Version Control with Git accelerated tutorial for busy academics
Distributed Version Control with git
An introduction to version control systems with Git
Version Control with git
LECTURE 3: Software Configuration Management
An introduction to version control systems with Git
Git CS Fall 2018.
Version Control System - Git
GitHub and Git.
Version Control with Git and GitHub
Version/revision control via git
Git GitHub.
Introduction to The Git Version Control System
Using GitHub for Papyrus Models Jessie Jewitt – OAM Technology Consulting/ ARM Inc. January 29th, 2018.
Presentation transcript:

Version Control with git

Version Control Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. Version control is like a big undo button for your project. It allows you to revert files back to a previous state, revert the entire project back to a previous state, compare changes over time, see who last modified something that might be causing a problem, who introduced an issue and when, and more. Using a VCS also generally means that if you screw things up or lose files, you can easily recover.

Examples Version control is most commonly realized with stand-alone applications such as git or svn but is also embedded in various types of software such as Google docs and Wikipedia (page history).

Development and Maintenance Use Cases Version control is essential when you have multiple developers working on the same code base. Version control is essential when you are supporting multiple versions of a software system over time. When a bug is reported in one version of the product you have to rebuild that version of the product, fix the bug and ship an updated version.

Categories of Version Control Systems The two main categories of version control systems are centralized (e.g. subversion or svn) and decentralized or distributed (e.g. git). With a centralized system the repository is located in one place. With a distributed system each user has a copy of the repository. CentralizedDistributed

Version Control Collaboration Models The main function of a version control system is to allow collaborative editing and sharing of data. There are two main strategies for enabling this: Lock-Modify-Unlock (aka reserved checkout) Copy-Modify-Merge (aka unreserved checkout or optimistic checkout)

Lock-Modify-Unlock

Copy-Modify-Merge

git Git is a fast, open source, distributed version control system. Git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005, and has since become the most widely adopted version control system for software development. Git is a simple command line tool for keeping a history on the state of project source code and documents. You tell it to track files in your project and periodically commit the state of the project when you want a saved point. Then you can share that history with other developers for collaboration, merge between their work and yours, and compare or revert to previous versions of the project or individual files.

git vs. github git != github git is a version control system. github.com is a web site where you can publish git repositories. Typical workflow: use git locally to manage a set of files. Push or publish to github to backup your work and share it with others.

git git has changed the way developers think of branching and merging. Branching and merging tends to be a big scary event with centralized repositories. Branching and merging are part of the daily workflow of developers using git. git supports non-linear development.

Three main sections of a git project Files tracked by git are in one of three states: committed, modified, or staged. This leads us to the three main sections of a Git project: the.git directory, the working directory, and the staging area.

git file stages UntrackedTracked

SHA-1 checksums in git git stores data in one big hash table or key-value data store. The keys are SHA-1 checksums. You see these checksums everywhere. For example, if you run git log --oneline you will see something like: $ git log --oneline b add readme file f118e0e update license text 6beda33 fixed issue 123 The hex values above are abbreviated SHA-1 checksum values or keys that point to commits.

SHA-1 checksums in git

git command line I will be demonstrating git using a command line interface. There are GUI options for using git. These usually support only a subset of the commands available from the command line. The command line is the only place you can run all Git commands. git GUI’s come and go. If you know how to use git from the command line, you can probably also figure out how to use git from any of the GUI options, while the opposite is not necessarily true. Also, while your choice of graphical client is a matter of personal taste, all users will have the command-line tools installed and available.

Contributing to a github project Unless you are part of the core development team for a project, you probably won’t have write access to the repository for the project. The standard procedure for contributing to a github project to which you don’t have write or push access is: 1.Find the project on github and select “Fork”. You now have a copy of the project in your own github workspace. 2.Create a topic branch for the changes you plan to make. 3.Make your changes (one or more: git add followed by git commit –m ‘message’). 4.Push your topic branch back to your repository. 5.Open a pull request from github 6.Discuss and optionally commit additional changes to your branch. 7.When ready, the product owner will merge your pull request.

Git Workflows There are many different version control workflows to choose from. A workflow is simply the procedures your team will follow when collaborating on development through your version control system. Popular options are: Centralized workflow Feature branch workflow Gitflow workflow

Centralized Workflow Git is a distributed version control system but you can use it like a centralized version control system (i.e. subversion). With the Centralized Workflow only the master branch is needed. Step-by-step: 1.Create a centralized repository on github or other git hosting server. 2.Each developers clones the centralized repository. 3.Developers work locally committing changes ever so often. 4.The first developer, say John, does a git push origin master to merge his changes with the central repository. There are no conflicts because it is a simple fast-forward merge. 5.A second developer, say Mary, attempts a git push origin master, but she gets an error message because her local copy is behind the remote copy. She must do a git pull origin master ( or git pull --rebase origin master) to merge John’s changes before she can push her changes. This may require manual merge resolution. After merging, Mary can retry the git push origin master.

Feature Branch Workflow The core idea behind the Feature Branch Workflow is that all feature development should take place in a dedicated branch instead of the master branch. With feature branches you can also use pull requests to initiate discussions around a branch before it gets integrated. Developers create a new branch every time they start work on a new feature. Feature branches can (and should) be pushed to the central repository. Provides a mechanism for sharing work and also serves as a backup for local commits.

Gitflow Workflow.