Distributed Version Control with git

Slides:



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

Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
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.
Distributed Version Control. Image stolen from which is really good, go read it.  Old-school version control.
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.
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.
Peter Ogden and Josh Levine.  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)
1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009.
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.
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.
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.
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.
Introduction to Git - Chirag Dani. Objectives Basics of Git Understanding different “Mindset of Git” Demo - Git with Visual Studio.
GIT: What, how and why ? Part 1: Basics. What do I know about git? Started using it for experiments on April 2009 Moved all voms development on git on.
INTRODUCTION TO GIT. Install Egit for eclipse Open eclipse->Help->Install New Software Search for one of the following -
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
Git In The Land of Version Control Systems A tutorial on getting git.
Jun-Ru Chang Introduction GIT Jun-Ru Chang
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
Version Control Systems
Basics of GIT for developers and system administrators
CS5220 Advanced Topics in Web Programming Version Control with Git
Introduction to GitHub
L – Modeling and Simulating Social Systems with MATLAB
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
11 Version control (part 2)
LECTURE 2: Software Configuration Management
Git Practice walkthrough.
SSE2034: System Software Experiment 3 Spring 2016
L – Modeling and Simulating Social Systems with MATLAB
Version Control overview
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
Akshay Narayan git up to speed with RCS Akshay Narayan
LECTURE 3: Software Configuration Management
The Big Picture
SIG: Open Week 1: GitHub Tim Choh.
Git-Github Tools Prepared for COP4331. Git-Github Tools Prepared for COP4331.
Version control with Git Part II
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Introduction to Git and GitHub
Git started with git: 2018 edition
Version Control with Git
Version Control with Git and GitHub
Git Introduction.
Introduction to Git and Github
Git GitHub.
Introduction to The Git Version Control System
Presentation transcript:

Distributed Version Control with git gti-scm book License Andrew Danner, SWICS 22 November 2013

Review of local git Do this once per network check git config -l if no user.name: git config --global user.name “My Name” git config --global user.email “me@place.com” Global options apply to all git repositories on the current system, e.g., CS network, your laptop, your future job See also https://help.github.com/articles/set-up-git

Starting a new repository One repo per project. Only need to do this when starting a new project or preparing to share git init woot Local, unshared git init --bare woot.bare Create a bare repo (helpful for sharing) Don’t make edits in this directory only push to, pull from bare repos git clone /home/adas/woot.bare localWoot clone an existing repo for sharing Usually only clone bare repos Don’t need to do all three of these every time

Daily workflow Edit old files Add new files git status git add “stages” files for commit git commit, git commit -m saves changes in history .gitignore ignore files that you don’t want to version control *.o, *.avi, *.bak, *~, .*.swp, build/*

Demo git config -l # if needed git config --global user.name=”Andrew Danner” git config --global user.email=”adanner@corgination.org” git init woot cd woot vim Readme.txt git status git add Readme.txt git commit -m "initial checkin" vim prog.py git add prog.py Readme.txt git commit -m "I'm programming" gitg

Reviewing changes git log gitg, gitx, gitk git status graphical browsers of git logs git status git commits store “changes” to working tree over time

Some git repo terminology Working Directory what your directory currently looks like pretend git wasn't there Stage (Index) Things that are added to be part of next commit Not committed yet History (Local repository) Committed from staging area Part of git history Stash Upstream (Remote repository) See also Git cheatsheet Link

Git Branching and Merging Use branches to work on multiple features in parallel Test out new ideas, fix bugs You should do most of your development work in a branch There seems to be a lot of branching FUD surrounding git. These folks probably were burned by some other VCS in the past that had poor branch support Git has great branch support

Demo - Branching git status #create and switch to new branch git checkout -b devel vim prog.py python prog.py git add prog.py git commit -m "awesome feature" #move to existing branch git checkout master git commit -a -m "documented code" git branch gitg & #fixing conflicts git merge devel git commit #fast forward merge after conflict git checkout devel git merge master #not all merges result in conflict master HEAD devel master HEAD master HEAD devel master HEAD devel master HEAD devel master HEAD devel master HEAD devel master HEAD devel

Git Branching and Merging git branch newfeature git checkout newfeature add some changes git checkout master use gitg to view repo history add changes. branch divergence!!! git merge <frombranch> merge conflicts and resolutions do not blindly add conflicted files back into git you will most likely break your code git branch lists, creates, deletes branches

Undoing changes git mv git rm removes from git and working tree git rm --cached only removes from git git checkout -- git revert, the anti-commit git rebase helpful when collaborating only use on local repos do not rebase remotes not really an undo. more of a redo

Remote repositories Sharing/Collaborating is usually done with a remote repository git clone git fetch, git pull git push git remote add git branch -a, -av, -avv Local stuff still applies push: share from your local to remote pull: pull from remote to your local

Demo: Remotes Guests Host #make share-able bare git repo gitcreate.sh myproject #make a copy to edit git clone share/myproject/ cd myproject/ ls touch README git add README git commit -m "initial commit" #create/track master branch git push -u origin master vim README git commit -a -m "added content to README" #get recent changes git pull gitg #make a copy to edit git clone share/myproject/ cd myproject/ ls vim README git add README git commit -m "more documentation" #push to existing remote master git push Guests Host

Remotes gitcreate.sh is CS only CS git server Github uses ACLs. OK, not great CS git server can work with people off campus need ssh keys talk to me or Jeff for repo setup Github create free public accounts not great for class project (public) private accounts for a fee After git clone, can ignore most of these details

Other commands Other tools git cherry-pick git stash git help Other tools Swarthmore git server github for more public projects git svn clone

Git resources Pro Git book Git @ Swat Git Terminology See also git help glossary Git Ready learn git one feature at a time Git Immersion Understanding Git Visual Git Reference Git Cheatsheet