An introduction to version control systems with Git

Slides:



Advertisements
Similar presentations
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.
Advertisements

1 Web Design Workshop DIG 4104c Spring 2014 Dr. J. Michael Moshell University of Central Florida Lecture 2: The git source control system
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Introduction to Git and Github Joshua imtraum.com.
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
Getting Started with GIT. Basic Navigation cd means change directory cd.. moves you up a level cd dir_name moves you to the folder named dir_name A dot.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
Peter Ogden and Josh Levine.  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
Drexel University Software Engineering Research Group Git for SE101 1.
…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.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Git Basics. Git stores data as snapshots of the project over time When commit Save all the files If files have not changed, point to the previous identical.
1 GIT NOUN \’GIT\ A DISTRIBUTED REVISION CONTROL AND SOURCE CODE MANAGEMENT (SCM) SYSTEM WITH AN EMPHASIS ON SPEED. INITIALLY DESIGNED AND DEVELOPED BY.
Version Control System Lisa Palathingal 03/04/2015.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
© 2015 by Herb Holyst Introduction to git Cytomics Workshop December, 2015.
CS 160 and CMPE/SE 131 Software Engineering February 16 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Introduction to Git - Chirag Dani. Objectives Basics of Git Understanding different “Mindset of Git” Demo - Git with Visual Studio.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Jun-Ru Chang Introduction GIT Jun-Ru Chang
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
Dr. Tanusri Bhattacharya
Version Control Systems
Basics of GIT for developers and system administrators
CS5220 Advanced Topics in Web Programming Version Control with Git
M.Sc. Juan Carlos Olivares Rojas
Information Systems and Network Engineering Laboratory II
Primož Gabrijelčič Git for Programmers Primož Gabrijelčič
11 Version control (part 2)
CReSIS Git Tutorial.
CS/COE 1520 Recitation Week 2
SSE2034: System Software Experiment 3 Spring 2016
Version Control overview
Version control with Git
Development and Deployment
Software Engineering for Data Scientists
Version Control with Git and GitHub
Version Control Systems
Version control with Git
An introduction to version control systems with Git
Version Control with Git accelerated tutorial for busy academics
SU Development Forum Introduction to Git - Save your projects!
Akshay Narayan git up to speed with RCS Akshay Narayan
Version Control with git
Introduction to Configuration Management
Setting up Git, GitBash, and GitHub
An introduction to version control systems with Git
Version control with Git
Version control with Git
Git CS Fall 2018.
Version control with Git
Version control with Git
Introduction to Git and GitHub
Version Control with Git
Version Control with Git and GitHub
GitHub 101 Using Github and Git for Source Control
Version/revision control via git
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
Advanced Git for Beginners
Presentation transcript:

An introduction to version control systems with Git

Version control systems Version control systems record changes to a file or set of files over time so that you can recall specific versions later Many systems have risen to popularity over the years RCS CVS Subversion We will focus on Git

Why use version control? These systems help with: Tracking changes Short and long term undo Backup and restore Synchronization Collaboration

Local version control systems log changes made to the file, any version can be restored at any time

Centralized version control systems now added features to help with synchronization (computers A and B owned by the same user) and collaboration (computers A and B owned by different users) also introduces problems: single point of failure, can't work offline

Distributed version control systems Copy of the version database in every working directory

The basic Git workflow Modify files in your working directory Stage the files, adding snapshots to your staging area Commit your changes to your local copy of the repository

The lifecycle of a file in Git Git does not necessary keep track of all files in your working directory

Example repository

Gitting started Set your identity Set other configuration options $ git config --global user.name "John Doe" $ git config --global user.email jdoe@example.com Set other configuration options $ git config --global color.ui true Get help $ git help <verb> Already installed on most Mac systems Can install Git shell on Windows or use PowerShell Git application

Creating a new repository $ git init Creates a new (empty) repository in the current directory

Copying a repository For this class, your instructor will create a repository for you, you will just need to copy it from GitHub to your computer using the following command: $ git clone <repository> Creates a copy of <repository> in the current directory

Staging files As you work, you will create new files and modify existing files, when you are satisfied with your changes, you can stage them for commit with: $ git add <file_pattern> Note this is not just for new files, but also for edited files

Committing changes Commits create a new version in the repository Include a commit message describing the new version $ git commit -m <msg> Note that this is a local operation

Checking working directory status $ git status Reports: Files in the working directory that are not tracked File modifications not yet staged for commit File additions and modifications staged for commit

Overviewing commit history $ git log Lists commits made to the current repository

Git example (cloning via GitHub) Go through example demonstrating the following commands: git clone https://github.com/PittCS1501/PITTID-project0.git ls cd PITTID-project0 nano P0.txt Or, use another text editor, use of nano doesn't matter git status git diff nano Status.txt git add P0.txt git add Status.txt git commit -m "finished project0" git push To end, view the repository on github.com, showing that the stuff you pushed appears there

Handy command - comparing versions It may be handy to see exactly how files changed $ git diff Shows modifications not yet staged for commit $ git diff <commit_id> Show changes since the commit specified $ git diff <commit_id1> <commit_id2> Show changes between two commits

What we've covered here... … presents only a brief overview of Git Further topics: branching rebasing tagging … Further resources: https://git-scm.com/book/en/v2 http://gitref.org/ http://gitimmersion.com/