Git – versioning and managing your software L. Grewe.

Slides:



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

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.
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.
Patterns & practices Symposium 2013 Introducing Git version control into your team Mark
SubVersioN – the new Central Service at DESY by Marian Gawron.
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: 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
Version control Using Git 1Version control, using Git.
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 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.
Version Control. How do you share code? Discussion.
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.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Distributed Version Control Systems (or Version Control for Hipsters) Rob Gaston, web developer Farallon Geographics, Inc. SF Department of Technology.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
CSE 219 Computer Science III CVS
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
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.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
Version Control and SVN ECE 297. Why Do We Need Version Control?
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.
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.
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories.
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
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
Version Control Systems
Git and GitHub primer.
11 Version control (part 2)
LECTURE 2: Software Configuration Management
Version Control.
Git Practice walkthrough.
Version Control overview
Version control, using Git
Development and Deployment
Software Engineering for Data Scientists
Version Control Systems
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
LECTURE 3: Software Configuration Management
SIG: Open Week 1: GitHub Tim Choh.
Getting Started with Git and Bitbucket
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Git started with git: 2018 edition
Patrick Cozzi University of Pennsylvania CIS Fall 2012
Version Control with Git and GitHub
Version/revision control via git
Git GitHub.
Introduction to The Git Version Control System
Presentation transcript:

Git – versioning and managing your software L. Grewe

What is Git? GIT = is a distributed revision control system for software. there are a number of free resources to use GIT and host remotely your code - GitHub and Bitbucket are popular you can also buy commercial versions Created by Linus Torvalds for work on the Linux kernel ~2005 Actually implements a replicated versioned file system

The concept Git maintains versions of software over time

The concept you have code on your local development machine (local git repository) that you can create versions of and commit to a remote Git repository. repository = a location storing and mantaining versioned code

The concept

Another view

Another powerful use -- rollback Scenario: there is a bug in the code that was committed --- you need to QUICKLY go back

3 roles of Git The HEAD (master) = last commit snapshot, pointer to the current branch The Index = proposed next commit snapshot The Working Directory = sandbox (local machine)

Common operations/ nominclature Operations to submit/get code Operations to revert code

Operations to submit/get code commit = the code is read to submit to repository push = pushes it to remote repository pull = gets current code from remote repository merge = if you are trying to push code that has been pushed more recently than you pulled it by another person -- the Git system will ask you to merge the files and clean up any descrepencies. o scenario - you and Jill pull down the current code and you are both working on a file called doit.java. Jill pushes her changed code first. Then you try to push your code??? you could have changed the code in the same place --what is the system to do. You need to go through the process of merging the code and figuring out what conflicts might exist

Operations to revert/undo to previous checkout = if you want to revert to a previous version BEFORE you have committed any changes revert = if you want to undo a certain commit o Sometimes you'll want to undo a certain commit. E.g. when you notice that your changes were wrong, when you introduced a bug, or simply when the customer has decided he doesn't want this anymore reset = if you want to go to a previous version but, not remove the commits ---basically it resets the HEAD(master) to an older branch

Groups of Git commands Setup and branch management o init, checkout, branch Modify o add, delete, rename, commit Get information o status, diff, log Create reference points o tag, branch

Some of the operations

Branching The next step

Branching the concept Sometimes you want to have two different paths the development of your software can go. Example: maybe you want to have a version for your corporate customers and a different version for your military customers It lets you create isolated development environments within a single repository.

Another use of branches Want to add a new feature or fix a you can spawn a new branch to encapsulate your changes. o makes sure unstable code is never committed to the main code base, and it gives you the chance to clean up your feature’s history before merging it into the main branch.

You can merge a branch into the master Using the merge command you can merge a branch back into the master Different kinds of merging

Lets look at some operations

Branches – the master is your first branch master A > git commit –m ‘my first commit’ NOTE: we are showing you the command line interface for git.. Note you can use GUI GIT tools for local repositories like SourceTree or others.

Adding commits to master master > git commit ***** ABC NOTE: we are showing you the command line interface for git.. Note you can use GUI GIT tools for local repositories like SourceTree or others.

Creating a New Branch and having master point to it bug123 master > git branch bug123 > git checkout bug123 OR short cut > git checkout –b bug123 > git branch bug123 > git checkout bug123 OR short cut > git checkout –b bug123 ABC NOTE: we are showing you the command line interface for git.. Note you can use GUI GIT tools for local repositories like SourceTree or others. At end of checkout master (start) points to bug123 branch

Continuing commits –will be where the head is pointing to –which is our bug123 branch master > git commit ****** ABC DE bug123 The commits are going to bug123

Lets point back to master master > git checkout master ABC DE bug123

Now we want to merge bug123 into our head (current pointing to master) bug123 master > git merge bug123 ABCDE

The results of merging master > git branch -d bug123 ABCDE Now lets delete our branch bug123

Another use scenario Let’s consider another scenario. Here we created our bug story branch back off of (C). But some changes have happened in master (bug 123 which we just merged) since then. And we made a couple of commits in bug 456.

Our starting place master ABCDE FG bug456

Check out master so we can merge next master ABCDE FG bug456 > git checkout master

Merge bug456 branch into head (master) master ABCDE FG > git merge bug456 H bug456 And now we merge, connecting the new (H) to both (E) and (G). Note that this merge, especially if there are conflicts, can be unpleasant to perform.

The results master ABCDE FG > git branch -d bug456 H Cleanup- delete branch bug456

Working in teams with Git How it can help you….

Working as a team My Local Repo Tom’s Repo Tracey’s Repo Matt’s Repo ABC ABCABC ABC Everyone has initially the same code on their local machines –checked out from remote master repository

Here we are working and we are sharing the remote repository My Local Repo Tom’s Repo Tracey’s Repo Matt’s Repo ABC ABCABC ABC Remote Repo A A B B C C D D D D D D

What will we do…. The next step

What we will use: BitBucket for remote GIT, eGit for support in Eclipse, local client SourceTree for details (try setting up the tutorial example and download SourceTree as part of it). SourceTree can be found directly at See class website for tips on how to setup and of course the websites for each product.

ADVICE: Git has a lot of commands Learn a core subset of them Use GUI tools (we use eGit in Eclipse with Bitbucket online remote Git repository) Then learn the rest as you need them

Have you heard of SVN – what is the difference with Git ….hmmmmm

SVN vs. Git SVN:  central repository approach – the main repository is the only “true” source, only the main repository has the complete file history  Users check out local copies of the current version Git:  Distributed repository approach – every checkout of the repository is a full fledged repository, complete with history  Greater redundancy and speed  Branching and merging repositories is more heavily used as a result  Conclusion –use Git

Who needs Git?