I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson

Slides:



Advertisements
Similar presentations
Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
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.
Patterns & practices Symposium 2013 Introducing Git version control into your team Mark
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
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.
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.
1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009.
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.
Source Control Primer Patrick Cozzi University of Pennsylvania CIS Spring 2012.
RMG Study Group Basics of Git Nathan Yee 2/23/
Version Control Systems academy.zariba.com 1. Lecture Content 1.What is Software Configuration Management? 2.Version Control Systems (VCS) 3.Basic 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.
Ernst Peter Tamminga Get started with GitHub XCESS expertise center b.v. Netherlands.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Version Control Systems. Version Control Manage changes to software code – Preserve history – Facilitate multiple users / versions.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
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.
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.
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.
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories.
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
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
Version Control Systems
CS5220 Advanced Topics in Web Programming Version Control with Git
Information Systems and Network Engineering Laboratory II
Discussion #11 11/21/16.
Primož Gabrijelčič Git for Programmers Primož Gabrijelčič
11 Version control (part 2)
Version Control.
Git Practice walkthrough.
GitHub workflow according to Google
Discussion 11 Final Project / Git.
Version control, using Git
CS5220 Advanced Topics in Web Programming Version Control with Git
Git branches and remotes
Software Engineering for Data Scientists
Version Control with Git and GitHub
Macaualy2 Workshop Berkeley 2017
Version Control Systems
Storing, Sending, and Tracking Files Recitation 2
An introduction to version control systems with Git
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
The Big Picture
SIG: Open Week 1: GitHub Tim Choh.
Git-Github Tools Prepared for COP4331. Git-Github Tools Prepared for COP4331.
Advantages Project Career Divide & Conquer Collaboration
Source Code Repository
Using Github.
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Git started with git: 2018 edition
Version Control with Git
GitHub and Git.
Patrick Cozzi University of Pennsylvania CIS Fall 2012
Version Control with Git and GitHub
Git Fundamentals.
Git Introduction.
Git GitHub.
1. GitHub.
Introduction to The Git Version Control System
Presentation transcript:

I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson @chasinglogic

Who Am I Mathew Robinson DevOps Engineer for The Kroger Co. Linux/FOSS Enthusiast for 13 years Documentation Connoisseur Developer

So you want to contribute to OSS So how many people in here have wanted to contribute to FOSS but have never gotten around to learning how?

But where do I start?

Git is the most ubiquitous tool in Open Source

What is Git? It's a Distributed Version Control System

A repository is a collection of commits, like a truck full of boxes

Create a repository with ‘git init’, like buying a new truck without any boxes * using git will not improve your photo editing skills

Get someone else’s repository using ‘git clone’, like buying a copy of their truck with the same boxes Mine Yours

Commits are the boxes in the truck

Changes or “edits” are stored in the commits

Additionally the commits have messages that describe the changes inside Update .gitignore

When working on your own repo, to make a commit first you’ll need to make some changes

Then you’ll need to use ‘git add’ to put those changes in the “staging area” $ git add MANIFEST.in

From there ‘git commit’ will take all changes in the staging area and put them into a commit $ git commit -m “update MANIFEST.in”

You now have added a commit to your repository! update MANIFEST.in

But now you have a commit that the remote repository does not Yours Mine update MANIFEST.in

And it’s likely the remote repository has commits that you do not Yours Mine update MANIFEST.in Added new test

First you must ‘git pull’ to accept a delivery from the remote of the commits you don’t have $ git pull origin master Yours Mine Added new test This is merging the commits, that’s why it’s called a pull request and not a merge request update MANIFEST.in Added new test

Now you can ‘git push’ to send a delivery of your commits to the remote repository $ git push origin master Yours Mine Added new test update MANIFEST.in update MANIFEST.in Added new test

Now what if the remote had a commit which contains changes on the same file we changed? Mine Yours

This causes a merge conflict because git does not know who’s version is right Mine Yours

To solve this problem, we can use branching Mine Yours

A branch takes a “snapshot” of the repo’s current HEAD (latest) commit $ git checkout -b update-manifest Your freshly cloned repo Branch: update-manifest If this looks like cloning it should! While branching is a similar operation there is a reason that we do the branching Someone else’s change Someone else’s change

Now you can apply your change on your branch Branch: master Branch: update-manifest update MANIFEST.in Someone else’s change Someone else’s change

Now when the remote is updated Remote Branch: origin/master Branch: master Clean up MANIFEST.in Someone else’s change Someone else’s change

We can pull those changes into our copy of the master branch $ git checkout master Remote Branch: origin/master Branch: master Clean up MANIFEST.in Someone else’s change Someone else’s change

We can pull those changes into our copy of the master branch $ git pull origin master Remote Branch: origin/master Branch: master Clean up MANIFEST.in Clean up MANIFEST.in Someone else’s change Someone else’s change

Now we can merge or rebase as necessary $ git checkout update-manifest $ git merge master # or $ git rebase -i master Branch: master Branch: update-manifest update MANIFEST.in Clean up MANIFEST.in Clean up MANIFEST.in Someone else’s change Someone else’s change

Now when we merge back to master it will fast-forward avoiding all merge conflicts $ git checkout master $ git merge update-manifest Branch: master Branch: update-manifest update MANIFEST.in update MANIFEST.in Clean up MANIFEST.in Clean up MANIFEST.in Someone else’s change Someone else’s change

The same is true when we push our master branch back up to the remote $ git push origin master Remote Branch: origin/master Branch: master update MANIFEST.in update MANIFEST.in Clean up MANIFEST.in Clean up MANIFEST.in Someone else’s change Someone else’s change

What we’ve covered git init git clone git add git commit git checkout git branch git merge && git rebase git push && git pull

$ git status Questions? You can find me on Twitter: @chasinglogic Github: @chasinglogic mrobinson@praelatus.io