Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.

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

Git Branching What is a branch?. Review: Distributed - Snapshots Files are stored by SHA-1 hash rather than filename Stored in git database in compressed.
Hosted Git github. From an alumni (2010)  You know, the more time I spent in industry the better I've understood what a strong advocate you are for the.
1 Web Design Workshop DIG 4104c Spring 2014 Dr. J. Michael Moshell University of Central Florida Lecture 2: The git source control system
Git
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: Part 1 Overview & Object Model These slides were largely cut-and-pasted from tutorial/, with some additions.
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.
علیرضا فراهانی استاد درس: جعفری نژاد مهر 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 ?
Peter Ogden and Josh Levine.  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)
Git – versioning and managing your software L. Grewe.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
Git (Get) it done right! Practical Applied Version Control for Drupal site developers Peter Chen - Stanford School of Engineering Technical Webmaster.
Drexel University Software Engineering Research Group Git for SE101 1.
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.
Git : Part 2 Checkout, Add, Commit These slides were largely cut-and-pasted from tutorial/, with some additions.
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.
1 Applied CyberInfrastructure Concepts ISTA 420/520 Fall
Git Super Basics. What is Git? Version Control System (VCS) Successor to SVN in the Drupal eco-system A tool.
Sofia Event Center May 2014 Martin Kulov Git For TFS Developers.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
Falcons Git Usage Andre Pool Version 2.0 October 2015 / Veldhoven.
Lecture 2 Making Simple Commits Sign in on the attendance sheet! credit:
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.
Hosted Git github. From an alumnus (2010)  You know, the more time I spent in industry the better I've understood what a strong advocate you are for.
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.
Carl’s Ultra-Basic Guide to the Command Line and Git Carl G. Stahmer Director of Digital Scholarship cstahmer UD Davis Data Science.
Installing git In Linux: sudo apt-get install git In Windows: download it from run the setuphttp://git-scm.com/download/win.
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.
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
Introduction to GitHub
Primož Gabrijelčič Git for Programmers Primož Gabrijelčič
Version Control Systems
11 Version control (part 2)
Version Control.
Git Practice walkthrough.
CS/COE 1520 Recitation Week 2
Software Engineering for Data Scientists
Macaualy2 Workshop Berkeley 2017
Akshay Narayan git up to speed with RCS Akshay Narayan
The Big Picture
SIG: Open Week 1: GitHub Tim Choh.
Using Github.
Git CS Fall 2018.
Version control with Git
Version Control with Git and GitHub
Git Fundamentals.
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
Presentation transcript:

Git How to 1

Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates to face industry challenges Efficiently working with research students Resource sharing 2

Getting Started 3

Git use snapshot storage 4

Getting Started Three stages of Git – The HEAD last commit snapshot, next parent – Index Proposed next commit snapshot – Working directory Sandbox 5

Getting Started A basic workflow – (Possible init or clone) Init a repo – Edit files – Stage the changes – Review your changes – Commit the changes 6

Getting Git to work Downloading – Install – Two interfaces: Command Line and GUI 7

Getting Started Init a repository Git init git init Initialized empty Git repository in /home/zachary/code/gitdemo/.git/ ls -l.git/ total 32 drwxr-xr-x 2 zachary zachary :51 branches -rw-r--r-- 1 zachary zachary :51 config -rw-r--r-- 1 zachary zachary :51 description -rw-r--r-- 1 zachary zachary :51 HEAD drwxr-xr-x 2 zachary zachary :51 hooks drwxr-xr-x 2 zachary zachary :51 info drwxr-xr-x 4 zachary zachary :51 objects drwxr-xr-x 4 zachary zachary :51 refs 8

Getting Started A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes Use your favorite editor 9

Getting Started A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes Git add filename git status # On branch master # Changes not staged for commit: # (use "git add..." to update what will be committed) # (use "git checkout --..." to discard changes in working directory) # # modified: hello.txt # no changes added to commit (use "git add" and/or "git commit -a") 10

Getting Started A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes Git status git add hello.txt git status # On branch master # Changes to be committed: # (use "git reset HEAD..." to unstage) # # modified: hello.txt # 11

Getting Started A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes Git commit # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD..." to unstage) # # modified: hello.txt # 12

Getting Started A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes 13

Getting Started View changes Git diff – Show the difference between working directory and staged Git diff --cached – Show the difference between staged and the HEAD View history Git log git log commit efb3aeae e a8f52969d705d04 Author: Zachary Ling Date: Sun Aug 28 15:02: Add second line commit eae3fc5a57b e a7357 Author: Zachary Ling Date: Sun Aug 28 14:59: Initial commit 14

Getting Started Revert changes (Get back to a previous version) – Git checkout commit_hash git log commit efb3aeae e a8f52969d705d04 Author: Zachary Ling Date: Sun Aug 28 15:02: Add second line commit eae3fc5a57b e a7357 Author: Zachary Ling Date: Sun Aug 28 14:59: Initial commit git checkout 4539 Note: checking out '4539'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at Initial commit 15

Branching Git sees commit this way… Branch annotates which commit we are working on 16

Branching 17

18

19

20

21

22

23

24

25

Merging What do we do with this mess? – Merge them 26

Merging Steps to merge two branch – Checkout the branch you want to merge onto – Merge the branch you want to merge 27

28

29

30

31

32

33

Branching and Merging Why this is cool? – Non-linear development clone the code that is in production create a branch for issue #53 (iss53) work for 10 minutes someone asks for a hotfix for issue #102 checkout ‘production’ create a branch (iss102) fix the issue checkout ‘production’, merge ‘iss102’ push ‘production’ checkout ‘iss53’ and keep working 34

Working with remote Use git clone to replicate repository Get changes with – git fetch – git pull (fetches and merges) Propagate changes with – git push Protocols – Local filesystem (file://) – SSH (ssh://) – HTTP ( – Git protocol (git://) 35

Working with remote One person project – Local repo is enough – No need to bother with remote Small team project – SSH write access for a few core developers – GIT public read access 36

Working with remote Use git remote add to add an remote repository Git remote add origin git remote origin 37

Working with remote Remote branching – Branch on remote are different from local branch 38

Working with remote Remote branching – Branch on remote are different from local branch – Git fetch origin to get remote changes – Git pull origin try to fetch reomte changes and merge it onto current branch 39

Working with remote Git push remote_name branch_name – Share your work done on branch_name to remote remote_name 40

Demonstration Refer handout 41

Q&A Any questions? 42