Thanks to our Sponsors! Community Sponsor Yearly Sponsor Marquee Sponsor.

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.
Patterns & practices Symposium 2013 Introducing Git version control into your team Mark
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
Introduction to Git and Github Joshua imtraum.com.
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,
Version control with Github August 26th, 2014 Daniel Schreij VU Cognitive Psychology departement
علیرضا فراهانی استاد درس: جعفری نژاد مهر 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 – 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.
Branching. Version Control - Branching A way to write code without affecting the rest of your team Merge branches to integrate your changes.
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.
…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 Fundamentals Rochelle Terman 13 January 2014.
Paul McGrath.  Speedy Input  Speedy Visualisation  Speedy Workflow.
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.
GitHub and the MPI Forum: The Short Version December 9, 2015 San Jose, CA.
1 Web Design Workshop DIG 4104c – Lecture 5c Git: Branch and Merge J. Michael Moshell University of Central Florida giantteddy.com.
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.
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.
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
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 Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
GIT: (a)Gentle InTroduction Bruno Bossola. Agenda About version control Concepts Working locally Remote operations Enterprise adoption Q&A.
CS5220 Advanced Topics in Web Programming Version Control with Git
Thanks to our Sponsors! Community Sponsor Yearly Sponsor
Information Systems and Network Engineering Laboratory II
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
Primož Gabrijelčič Git for Programmers Primož Gabrijelčič
Git and GitHub primer.
11 Version control (part 2)
SVN intro (review).
LECTURE 2: Software Configuration Management
GitHub workflow according to Google
Sign in on the attendance sheet!
Version control, using Git
CS5220 Advanced Topics in Web Programming Version Control with Git
Software Engineering for Data Scientists
Version Control with Git and GitHub
Macaualy2 Workshop Berkeley 2017
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
Version Control with git
LECTURE 3: Software Configuration Management
BIT 286: (Web) Application Programming
The Big Picture
Git CS Fall 2018.
Version Control System - Git
Paul S Waters Getting Git.
Git started with git: 2018 edition
GitHub 101 Using Github and Git for Source Control
Hop Aboard the Git Train – Transitioning from TFVC
Introduction to The Git Version Control System
How l learned to work with others instead of working around them.
Git in Visual Studio.
Presentation transcript:

Thanks to our Sponsors! Community Sponsor Yearly Sponsor Marquee Sponsor

Git Merge vs Rebase Utah Code Camp - Spring 2016

Who Are You? Josh Jones Game Programmer - Wild Works Chair - IGDA Salt Lake City/Provo Area Chapter ~8 years using git Audience Command Line users? GUI users? (TortoiseGit, SmartGit, etc.) GitHub? BitBucket? Unfuddle?

Follow Along? These slides: (BIT DOT LY SLASH ONE X p x X W V) Git repo:

Basic VCS Overview Provide backups or snapshots of code as it is developed so things can easily be reverted. Allow collaboration. Develop in parallel with branches and resolve conflicts later. Simple workflow: Clone/Checkout/Switch/Pull/Update/Sync/Merge - acquire code Modify/Diff/Branch/WorkDir/Repo/Stash - edit code, view changes, store changes Commit/Submit/Patch/ChangeSet/PR - declare your changes to the code base Push/Commit/CopyTo/CopyUp - share code Other amenities (blame, pull requests, line endings, ignore, etc.)

Git merge vs rebase - high level Merge Preserves the most information (--no-ff) More ugly (cluttered) history Easier to understand Less Fast-Forward merges after integration Pull Reviews are more clear Rebase Preserves less information Cleaner (less cluttered) history Requires learning rebase More clean merges after integration Can confuse Pull Reviews

Git Merge Used to integrate two branches together. Creates a Merge Commit unless merge is Fast Forwarded. Local vs Remote branches. May result in conflicts- automatically highlighted in merge commit. Straightforward concept. Ultimately necessary for collaboration on the same code base with branches.

Git Merge Example Command Line git clone git checkout -b featureToMerge1 (make changes) git commit -a -m "worked on my feature 1" git checkout master (make changes) git commit -a -m "master my update 1" git merge featureToMerge1 (normally pull) git log --pretty --graph (note the merge commit) TortoiseGit Right-click in workspace, clone: Switch/Checkout... leave top option as master, check create branch box: featureToMerge2 (make changes) Commit to: featureToMerge2 Switch/Checkout... choose: master (make changes) Commit to: master (make sure master is sync'd) Merge... choose branch: featureToMerge2 Show log

Git Rebase Used to change where a branch is "based" - where it applies its changes and commits. Time travel - can change history! Generally requires you to force push after. Upstream, Branch, and Newbase (-onto). Skips identical commits by default. Handling merge conflicts (-abort, -continue, and -skip). Similar commands and flags such as squash and --amend may be useful. An immensely deep and versatile command.

Do NOT force push to shared branches!

Git Rebase Example git branch featureToRebase1 (on master, make changes) git commit -a -m "master my update 2" git checkout featureToRebase1 (make changes) git commit -a -m "worked on my feature 2" git rebase master ( sync first, master is the upstream ) (resolve conflicts, git add, git rebase --continue) (force push to your remote branch for PR) git checkout master (make sure master is synced) git merge featureToRebase1 git log --pretty --graph (if fast-forward, note the lack of merge commit) Create Branch... featureToRebase2 (don't switch) (on master, make changes) Commit to: master Switch/Checkout... choose: featureToRebase2 (make changes) Commit to: featureToRebase2 (you might have to click all branches in log here) Rebase... choose upstream: master, Start Rebase (resolve conflicts if needed until Done) (log should show the commit from master) Switch/Checkout... choose: master Merge... choose branch: featureToRebase2 Show log

Git merge vs rebase - high level (again) Merge Preserves the most information (--no-ff) More ugly (cluttered) history Easier to understand Less Fast-Forward merges after integration Pull Reviews are more clear Rebase Preserves less information Cleaner (less cluttered) history Requires learning rebase More clean merges after integration Can confuse Pull Reviews

Workflows (from general articles online- any workflow can be made with the opposite option) Centralized (single master branch) - prefers rebase Feature Branches (develop and master branches) - prefers merge --no-ff Distributed/Fork Workflows - no preference/mixed Version/Release Branches - prefers merge Topic Branch - prefers rebase Skullcandy Workflow - prefers merge --no-ff

Resources / Questions? These slides: