Version Control with Git and GitHub

Slides:



Advertisements
Similar presentations
An Introduction By Sonali and Rasika.  Required for the project  Show the versions of your code in the course of development  Show versions of your.
Advertisements

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
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.
Git – versioning and managing your software L. Grewe.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Source Control Primer Patrick Cozzi University of Pennsylvania CIS Spring 2012.
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.
1 Applied CyberInfrastructure Concepts ISTA 420/520 Fall
1 GIT NOUN \’GIT\ A DISTRIBUTED REVISION CONTROL AND SOURCE CODE MANAGEMENT (SCM) SYSTEM WITH AN EMPHASIS ON SPEED. INITIALLY DESIGNED AND DEVELOPED BY.
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.
It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.
Introduction to Git - Chirag Dani. Objectives Basics of Git Understanding different “Mindset of Git” Demo - Git with Visual Studio.
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
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
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
Introduction to Git and git-svn Paul Gier Red Hat Sept. 27, 2011.
Basics of GIT for developers and system administrators
CS5220 Advanced Topics in Web Programming Version Control with Git
Discussion #11 11/21/16.
Git and GitHub primer.
11 Version control (part 2)
CReSIS Git Tutorial.
Git-Github Safa Prepared for the course COP4331 – Fall 2016.
Version control with Git
LECTURE 2: Software Configuration Management
Version Control.
Version Control overview
Version control with Git
Software Engineering for Data Scientists
Version Control with Git and GitHub
Storing, Sending, and Tracking Files Recitation 2
Version control with Git
An introduction to version control systems with Git
Version Control with Git accelerated tutorial for busy academics
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
An introduction to version control systems with Git
(Advanced) Web Application Development
Version Control with git
LECTURE 3: Software Configuration Management
The Big Picture
SIG: Open Week 1: GitHub Tim Choh.
An introduction to version control systems with Git
Git-Github Tools Prepared for COP4331. Git-Github Tools Prepared for COP4331.
Version control with Git
Version control with Git
Advantages Project Career Divide & Conquer Collaboration
Version control with Git
Version Control System - Git
Version control with Git
Version control with Git
Introduction to Git and GitHub
Version Control with Git
Patrick Cozzi University of Pennsylvania CIS Fall 2012
Systems Analysis and Design I
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
CSE 391 Lecture 9 Version control with Git
Presentation transcript:

Version Control with Git and GitHub

Lets look at the course website

Why use version control? Enables collaboration Merge changes to the same file View how code changes over time Visualize history of a code file Revert to specific version Recent change breaking things? Undo! See who is contributing Find all changes by username Backup Master copy is kept elsewhere (hopefully) Great for solo projects too!

Basics of Version Control https://snipcademy.com/code/img/tutorials/git/introduction/cvs.svg

Basics of Version Control Each user has a working copy Changes must get committed to the server Might require a merge

Types of Version Control Older VCS were “centralized” CVS SVN Distributed version control! Git Mercurial with GitHub for hosting and services

Distributed Version Control

GitHub-User Perspective You GitHub Working Dir Local Repos Remote Repos

First: Lets set up Git git config --global user.name “Austin Henley” git config --global user.email azh@utk.edu git clone https://github.com/utk-cs/test.git git config credential.helper store git pull Warning: stores pw in plaintext locally Alternative: setup Git to use SSH

Optional: If you don’t like VI If VS Code is installed and in your PATH Test by doing: code –help git config --global core.editor “code --wait” git config --global -e

Try it!

Working with Git working directory staging area gets repo from GitHub local repository clone remote repository

Working with Git working directory add stages files you changed staging area local repository remote repository

Working with Git working directory staging area commit saves changes local repository remote repository

Working with Git working directory sends all your commits to GitHub staging area local repository push remote repository

Working with Git working directory staging area gets latest version from GitHub local repository pull remote repository

Handy commands Get the repo for the first time git clone https://foobar See the status of your local repo git status Stage a file you modified git add filename Stage all modified files git add -A Commit staged changes git commit -m ”Foobar” Push your commits to GitHub git push

Try it!

Get previous versions See commits to a file git log filename Get previous version of repo git checkout commitid . Get previous version of file git checkout commitid -- filename Go back specific number of commits (e.g., 5) Git checkout master~5 -- filename Return to latest version git checkout master

I made a mistake! How do I… Unstage a file? git reset HEAD filename Uncommit? git reset --soft HEAD^ Undo your changes and go back to a fresh repo? git reset --hard HEAD^ Careful!!!

How to organize a commit? Commits should be logical groupings of code changes E.g., all the changes to fix a bug Try to make commits small and frequent Not fun to look through 2000 lines of changes across 11 files 

A Few Resources A tutorial A visual explanation of Git https://git-scm.com/docs/gittutorial A visual explanation of Git http://marklodato.github.io/visual-git-guide/index-en.html Git cheat sheet for commands https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf

Lets walk through GitHub