A Simple Introduction to Git: a distributed version-control system CS 5010 Program Design Paradigms “Bootcamp” Lesson 0.5 © Mitchell Wand, 2012-2014 This.

Slides:



Advertisements
Similar presentations
Intro to Version Control Have you ever …? Had an application crash and lose ALL of your work Made changes to a file for the worse and wished you could.
Advertisements

Irish Butterfly Monitoring Scheme Tutorial for online system
How to post to Wordpress Chruton Budd. Click on the Login link.
Today Rest of the demos (no escape!) Now that you tried group work without version control, making your life easier WITH it. You all got groups for #2?
SharePoint document libraries I: Introduction to sharing files How to add and edit files Wondering how to actually work with a document library? You’re.
A Simple Introduction to Git: a distributed version-control system CS 5010 Program Design Paradigms “Bootcamp” Lesson 0.5 © Mitchell Wand, This.
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.
Making a Book Report in Alice by Jenna Hayes Under the direction of Professor Susan Rodger Duke University, June 2010.
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.
Microsoft ® Office SharePoint ® Server 2007 Training SharePoint document libraries I: Introduction to sharing files Bellwood-Antis School District presents:
Why you should be using Version Control. Matt Krass Electrical/Software Engineer November 22, 2014.
Version Control with Subversion Quick Reference of Subversion.
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.
Warmup A programmer’s wife tells him, “Would you mind going to the store and picking up a loaf of bread? Also, if they have eggs, get a dozen.” The programmer.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Object-Oriented Software Engineering Using UNIX groups and Subversion Estimated Time: minutes “Unix is user-friendly. It's just very selective about.
Microsoft ® Office SharePoint ® Server 2007 Training SharePoint document libraries II: All about checkout Bellwood-Antis School District presents:
SharePoint document libraries I: Introduction to sharing files Sharjah Higher Colleges of Technology presents:
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.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Go to your school’s web locker site school name.schoolweblockers.com) Your user name is the first letter of your first name, the first 4.
Using Subversion and TortoiseSVN for Windows by Galen Wilkerson Gund Institute for Ecological Economics University of Vermont
(Sub)Version Control. 2 Keep large teams working on the same code Back up your work so you don't lose it all Compare changes to previous versions Revert.
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 What to do before class starts??? Download the sample database from the k: drive to the u: drive or to your flash drive. The database is named “FormBelmont.accdb”
IPortal Bringing your company and your business partners together through customized WEB-based portal software. SanSueB Software Presents iPortal.
Dealing with Conflicting Updates in Git CS 5010 Program Design Paradigms “Bootcamp” Lesson 0.6 © Mitchell Wand, This work is licensed under a.
When collaborating, it is important to manage changes in the models. For example: –To create or edit a submodel E.g. Habitat suitability is replaced with.
Intro to Git presented by Brian K. Vagnini Hosted by.
Version Control and SVN ECE 297. Why Do We Need Version Control?
The Last Lecture CS 5010 Program Design Paradigms "Bootcamp" Lesson © Mitchell Wand, This work is licensed under a Creative Commons Attribution-NonCommercial.
SECTION 1: CODE REASONING + VERSION CONTROL slides borrowed and adapted from Alex Mariakis and CSE 390a Justin Bare & Deric Pang.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 16 – Version control and git.
Donor's Choose Starter Instructions by Neely Swygert Teacher-Librarian Gadsden Elementary.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Blue Ridge Unified School District.  How will this help me? My Family Link  Where do I get started? Personal Profile Page  How do I manage my webpage?
Training Deck Microsoft Corporation Store, sync, and share your work files.
© Trustees of Indiana University Released under Creative Commons 3.0 unported license; license terms on last slide. Take Group Projects to the Next Level.
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories.
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.
TechKnowlogy Conference August 2, 2011 Using GoogleDocs for Collaboration.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
Version Control Systems
Information Systems and Network Engineering Laboratory II
Discussion #11 11/21/16.
Version Control with Subversion
A Simple Introduction to Git: a distributed version-control system
Version Control.
Keeping track of all the copies of your files
Discussion 11 Final Project / Git.
A Simple Introduction to Git: a distributed version-control system
Version Control Systems
An introduction to version control systems with Git
Version Control with Git accelerated tutorial for busy academics
Introduction to Configuration Management
BIT 286: (Web) Application Programming
Microsoft® Office Word 2007 Training
Getting Started with Git and Bitbucket
Git CS Fall 2018.
Git started with git: 2018 edition
GitHub 101 Using Github and Git for Source Control
Using GitHub for Papyrus Models Jessie Jewitt – OAM Technology Consulting/ ARM Inc. January 29th, 2018.
Presentation transcript:

A Simple Introduction to Git: a distributed version-control system CS 5010 Program Design Paradigms “Bootcamp” Lesson 0.5 © Mitchell Wand, This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. Creative Commons Attribution-NonCommercial 4.0 International License 1

Learning Objectives At the end of this lesson you should be able to explain: – how git creates a mini-filesystem in your directory – what commit, push, pull, and sync do – the elements of the basic git workflow – how git allows you to work across multiple computers – how git allows you and a partner to work together 2

Git is a distributed version-control system You keep your files in a repository on your local machine. You synchronize your repository with a repository on a server. If you move from one machine to another, you can pick up the changes by synchronizing with the server. If your partner uploads some changes to your files, you can pick those up by synchronizing with the server. 3

Git is a distributed version-control system Terminology: In git-speak, a “version” is called a “commit.” Git keeps track of the history of your commits, so you can go back and look at earlier versions, or just give up on the current version and go back some earlier version. 4

A simple model of git Most git documentation gets into details very quickly. Here’s a very simple model of what’s going on in git. 5

Your files my-projectdocsmanual.docxuser_docs.docxsrcmain.rktmodule1.rktmodule2.rktmodule3.rkt Here are your files, sitting in a directory called my- project 6

Your files in your git repository my-projectdocsmanual.docxuser_docs.docxsrcmain.rktmodule1.rktmodule2.rktmodule3.rkt.git When you have a git repository, you have an additional directory called.git, which points at a mini-filesystem. This file system keeps all your data, plus the bells and whistles that git needs to do its job. All this sits on your local machine. 7

The git client.git This mini-filesystem is highly optimized and very complicated. Don’t try to read it directly. The job of the git client (either Github for Windows, Github for Mac, or a suite of command-line utilities) is to manage this for you. 8

Your workflow (part 1) You edit your local files directly. – You can edit, add files, delete files, etc., using whatever tools you like. – This doesn’t change the mini-filesystem, so now your mini-fs is behind. 9

A Commit.git commit When you do a “commit”, you record all your local changes into the mini-fs. The mini-fs is “append-only”. Nothing is ever over-written there, so everything you ever commit can be recovered. 10

Synchronizing with the server (1).git push At the end of each work session, you need to save your changes on the server. This is called a “push”. Now all your data is backed up. You can retrieve it, on your machine or some other machine. We can retrieve it (that’s how we collect homework) your local machine a server, somewhere on the internet, eg. github.com 11

Synchronizing with the server (2).git pull To retrieve your data from the server, you do a “pull”. A “pull” takes the data from the server and puts it both in your local mini-fs and in your ordinary files. If your local file has changed, git will merge the changes if possible. If it can’t figure out how to the merge, you will get an error message. We'll learn how to deal with these in the next lesson. your local machine a server, somewhere on the internet, eg. github.com pull 12

The whole picture.git pull your local machine a server, somewhere on the internet, eg. github.ccs.neu.edu pull commit push 13

The whole picture using GHFW.git your local machine a server, somewhere on the internet, eg. github.ccs.neu.edu sync commit In Gihub For Windows or Github For Mac, “push” and “pull” are combined into a single operation called “sync”. So in these clients, there are only two steps (“commit” and “sync”) to worry about, not three. sync 14

Your workflow (2) sync edit commit edit commit edit commit sync Best practice: commit your work whenever you’ve gotten one part of your problem working, or before trying something that might fail. If your new stuff is screwed up, you can always “revert” to your last good commit. (Remember: always “revert”, never “roll back”) 15

Using Github for Windows/Mac 16

Your workflow with a partner sync edit commit edit commit edit commit sync edit commit edit commit edit commit sync edit commit edit commit edit commit sync You Your Partner (or you on another computer) Your partner gets your work from the server You get your partner’s work from the server server 17

The new github desktop In the next few slides, we’ll give you the updates for We won’t be using github.com. Instead we will be using “Github for Enterprise” at The user interface for GHFW/GHFM has changed. It’s now called “Github Desktop”. In the next few slides, we’ll show you how your daily workflow looks with new interface. 18

Starting your work session Here’s what your Github Desktop should look like when you open it up. Observe that your repos will be in the section labeled “Enterprise”. 19

Where am I? The open blue circle indicates that you are looking at the most recent local files 20

Always start by syncing This will download any changes that you or your partner have made on other machines 21

Click on a dot to see a commit Clicking on the last dot will show you what was in your last commit The dot turns blue 22

In this view, you can see the first 6 characters of the unique identifier (“the SHA”) for this commit You’ll need it for your Worksession Report This shows your commit SHA 23

Now let’s work on our file Now the screen shows an uncommitted change. 24

We write a commit message. Then we’ll click on “Commit to Master” Next, we commit our work 25

Now it says “No uncommitted changes” again. You can also undo the commit if you want. Here’s what you’ll see after a commit 26

Click on the open circle to see what was in your commit, and to record the commit SHA. Here’s that screen again: Be sure to record the commit SHA 27

Your work is not saved on the server until you sync. Be sure to sync!!! 28

Submit a Work Session Report At the end of your work session, submit a work session report via the web. The URL for the work session report will appear in each problem set. The report will ask for the SHA of your last commit. You can get this from the Github Desktop, as we’ve shown you. 29

Summary In this lesson you have learned – that git creates a mini-filesystem in your directory – what commit, push, pull, and sync do – the elements of the basic git workflow – how git allows you to work across multiple computers – how git allows you and a partner to work together 30