It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.

Slides:



Advertisements
Similar presentations
Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
Advertisements

Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
Introduction to git Alan Orth Nairobi, Kenya September, 2010 version control for serious hackers ;)
GIT is for people who like SVN September 18 th 2012 Vladimir Kerkez and BK.
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.
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Introduction to Git and Github Joshua imtraum.com.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Fundamentals of Git By Zachary Ling 29 th, Aug,
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.
Git. What’s Git? A British swear A Distributed Version Control System Developed in 2005 by Linus Torvalds for use on the Linux Kernel Git Logo by Jason.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
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.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Version Control Systems academy.zariba.com 1. Lecture Content 1.What is Software Configuration Management? 2.Version Control Systems (VCS) 3.Basic Git.
…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.
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.
Introduction to GitHub Alex Bigazzi Dec. 4, 2013 ITS Lab GitHub Introduction1.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
Git overview for RoboCup Andre Pool, September 2015.
QUICK START OF GITHUB Lin Shuo-Ren 2013/3/6 1. Why We Should Control The Version Although it rains, throw not away your watering pot. All changes should.
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.
CS 160 and CMPE/SE 131 Software Engineering February 16 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
An Introduction to Git David Johndrow COMP 490 – Senior Design & Development 2/11/16.
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.
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
Installing git In Linux: sudo apt-get install git In Windows: download it from run the setuphttp://git-scm.com/download/win.
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.
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.
Backing up a machine with git
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
CS5220 Advanced Topics in Web Programming Version Control with Git
Information Systems and Network Engineering Laboratory II
Version Control Systems
Git and GitHub primer.
11 Version control (part 2)
Git Practice walkthrough.
Version Control overview
Version Control System using Git
Development and Deployment
Software Engineering for Data Scientists
Macaualy2 Workshop Berkeley 2017
Storing, Sending, and Tracking Files Recitation 2
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
LECTURE 3: Software Configuration Management
Git CS Fall 2018.
Version control with Git
CMPE/SE 131 Software Engineering February 14 Class Meeting
Patrick Cozzi University of Pennsylvania CIS Fall 2012
Version Control with Git and GitHub
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
Presentation transcript:

It’s not just an insult from Harry Potter!

What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System (CVCS) Version control tracks changes to files – Extremely useful for software development – Allows backtracking to previous versions Widely used on open source projects – Linux kernel – Django – jQuery – LibreOffice

History of Git 101 Linux was created in 1991 by Linus Torvalds Used BitKeeper for source code management – BitKeeper is a proprietary DVCS that was free for Free and Open Source (FOSS) projects BitKeeper withdrew free access to the Linux project due to issues with the terms of service Linus created a new FOSS DVCS in 2005 called git (in 2 weeks)

Philosophy Behind Git Distributed Performance Guaranteed code that goes in comes out identical Open source was not a motivator – “I do open source because I think it’s the only right way to do software, but I will use the right tool for the job.” – Linus Torvalds, 2007

Why not SVN? Git repositories have a much smaller footprint compared to SVN – Mozilla switched from SVN to git – reduced size from 12 Gb to 400 Mb Git is significantly faster than SVN – Commits are local – Branches are almost instant, even for large projects “If it’s not distributed, it’s not worth using” – Linus Torvalds, 2007

Why not SVN? (cont’d) Centralized means some people have commit access – some don’t – How do you determine who gets access? Git assumes other developers are idiots* All developers can make their own changes independently of each other Developers can decide to pull changes from each other * As explained by Linus Torvalds

Why not SVN? (still cont’d*) All repositories are full backups – Complete with entire commit history – Theoretically, no repository is more important than any other Branches are made almost instantly Branches carry entire repository history *Ya, there are that many reasons to not use SVN

Typical Git Repository Source: git-scm.com

Fork a Repository Go to GitHub.com and create a new account – (Or sign in to your existing account) Go to Fork the repository – This creates your own copy of my repository – You have full access to modify all files

Get a Local Copy Connect to ceclnx01.cec.miamioh.edu – Putty or ssh Use this command git clone /GitTutorial.git Check the directory (ls –al) – You should see a directory called GitTutorial Change to this directory (cd GitTutorial) Look at the files (ls –hal)

Make Your First Commit Open a file (vi githubfile.txt) and make some changes. Close the file Look at what can be saved in a commit git status View changes to the file by running git diff Add the file to the “Staging Area” git add githubfile.txt View the Staging Area git status Commit the change with a message git commit –m ‘This is a useful explanation’

View Your Commit Check your commits (and all commits to a repo) with git log On large projects, this is inconvenient. View most recent n commits with git log –n EX: git log -2

Push Your Changes to Your GitHub Account Putting changes online is vital for working with others ‘Push’ your changes to the cloud with git push origin master Enter your login credentials Your commit should now be viewable online

What just happened? git push origin master Push – tells git to send the changes to another repository Origin – the name of the remote repository

Remote Repositories Another copy of the repository in a different location The copy on GitHub’s servers is a remote repository View your repo’s remotes with git remote When cloning a repo, git automatically uses the term ‘origin’ to map to it Add/remove a new remote repo with git remote add/remove

git push origin master Master – the name of the branch

Branches A git repo is set up like a tree ‘Branches’ are offshoots of the main repo They create separate commit history

Branches (cont’d) View your current branches git branch Master is the default main branch Master branch is typically reserved for “release-worthy” states – Some workflows differ Create new branches for addressing new features, issues, or experimenting

Branching & Issues in Git Source: git-scm.com

Branches: Differences from SVN SVN branches create entirely new files – Makes branching expensive – Can take up to several minutes to create a branch Git branches create new delta logs – Creates a new file containing ~100 bytes per file – Almost instant Branching in git is a regular part of a git workflow

Addressing a New Issue Issue #1 : githubfile.txt must have some more text in it. Create a new branch git branch iss1 View branches git branch Switch to that branch git checkout iss1 Make some changes to githubfile.txt

Security Concern! Hotfix Necessary! There is an issue with rogerskw.txt It needs to begin with “Hello, World!” or the hackers can get in! iss1 is not ready to be pushed to production Commit changes in iss1 Switch back to master – Open up githubfile.txt and look at its contents Create a new branch for the hotfix and switch to it git checkout –b hotfix

Push the Hotfix Add ‘Hello, World!’ to the beginning of rogerskw.txt Save and commit the change Switch back to master Merge the changes from hotfix to master git merge hotfix Now push the fix to production (the GitHub repo)

Merging in Git Source: git-scm.com

Merges in Git Source: git-scm.com

Continue on with Issue 1 Make some changes to rogerskw.txt and githubfile.txt Add and commit git add. && git commit –m ‘issue 1: asdf’ Switch back to master Merge

Merge Issues Often times files will not merge easily This is where the developer needs to go through the code and find and fix inconsistencies Open rogerskw.txt and look at the merge issues Fix them (remember to not undo the security concern) Push Issue 1 to production

Congratulations! You understand the basics of working with git and GitHub Go make some cool stuff!