Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.

Slides:



Advertisements
Similar presentations
TortoiseSVN By Group 1 Team B. Installing TortoiseSVN.
Advertisements

Version Control CS440 – Introduction to Software Engineering © 2014 – John Bell Based on slides prepared by Jason Leigh for CS 340 University.
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.
om om GIT - Tips & Tricks / git.dvcs git-tips.com
Using subversion COMP 2400 Prof. Chris GauthierDickey.
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.
Git A distributed version control system 23-Aug-15.
1 Web Design Workshop DIG 4104c Spring 2014 Dr. J. Michael Moshell University of Central Florida Lecture 2: The git source control system
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
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 with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
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 ?
Peter Ogden and Josh Levine.  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)
Created by: Maria Abrahms Modified Date: Classification: How to get it done Contributing to OpenStack.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Drexel University Software Engineering Research Group Git for SE101 1.
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.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Git Fundamentals Rochelle Terman 13 January 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.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Sofia Event Center May 2014 Martin Kulov Git For TFS Developers.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
L.T.E :: Learning Through Experimenting Using google-svn for MtM Docs Development Denis Thibault Version 3.2 Mar 12 th, 2009.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
WinCVS Training è Basic Concepts è Download & Setup è Importing a new module into CVS Repository è Getting new module from CVS è Getting Latest version.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
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. Install Egit for eclipse Open eclipse->Help->Install New Software Search for one of the following -
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
Carl’s Ultra-Basic Guide to the Command Line and Git Carl G. Stahmer Director of Digital Scholarship cstahmer UD Davis Data Science.
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.
Jun-Ru Chang Introduction GIT Jun-Ru Chang
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 for bzr users October Aurélien Gâteau An attempt at making you comfortable when you have to work with a git repository.
Backing up a machine with git
Basics of GIT for developers and system administrators
CReSIS Git Tutorial.
Setting up Git, GitBash, and GitHub
Version Control overview
An introduction to version control systems with Git
Version Control with Git accelerated tutorial for busy academics
SU Development Forum Introduction to Git - Save your projects!
Akshay Narayan git up to speed with RCS Akshay Narayan
A distributed version control system
An introduction to version control systems with Git
Setting up Git, GitBash, and GitHub
An introduction to version control systems with Git
Version Control System - Git
Version control with Git
Version Control with Git
Version Control with Git and GitHub
Version/revision control via git
Git GitHub.
Using GitHub for Papyrus Models Jessie Jewitt – OAM Technology Consulting/ ARM Inc. January 29th, 2018.
Advanced Git for Beginners
Presentation transcript:

Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16

Version control systems Version control (or revision control, or source control) is all about managing multiple versions of documents, programs, web sites, etc. Almost all “real” projects use some kind of version control Essential for team projects, but also very useful for individual projects Some well-known version control systems are CVS, Subversion, Mercurial, and Git CVS and Subversion use a “central” repository; users “check out” files, work on them, and “check them in” Mercurial and Git treat all repositories as equal Distributed systems like Mercurial and Git are newer and are gradually replacing centralized systems like CVS and Subversion 2

Why version control? For working by yourself: Gives you a “time machine” for going back to earlier versions Gives you great support for different versions (standalone, web app, etc.) of the same basic project For working with others: Greatly simplifies concurrent work, merging changes For getting an internship or job: Any company with a clue uses some kind of version control Companies without a clue are bad places to work 3

Download and install Git Tutorials Standard one: Here’s one from StackExchange: definitive-practical-guide# definitive-practical-guide# Install Git on your machine from Accept context menu items Git access: Right click from windows explorer gitBash to enter commands Current local directory is folder you launched from Good idea - one folder for your git local access 4

Introduce yourself to Git Start git / gitBash See your options: git config -l Enter these lines (with appropriate changes): git config --global user.name "John Smith" git config --global user. You only need to do this once If you want to use a different name/ address for a particular project, you can change it for just that project cd to the project directory Use the above commands, but leave out the --global 5

Setting options When you “commit,” git will require you to type in a commit message For longer commit messages, you will use an editor To change the default editor: git config --global core.editor /usr/bin/vim You may also want to turn on colors: git config --global color.ui auto See your options: git config -l 6

Clone repositories on panther Our repositories Get the files from your repository before starting Make a local respository as a clone of master Make a new folder Right click the folder and choose git bash Type: git clone Enter your ecampus password See all the contents of the folder Windows Explorer: Change folder and search options to show hidden files, folders and drives Git Bash (unix) : ls -a to see the.git folder. 7

Using Gui to Clone repository 8 Open git Gui Choose Clone Existing Repository Source: Target: New folder on your system Enter password 3 times

GitBash Changing your repositories Make changes See what changed git diff Stage changes git add –all (or particular files) note 2 dashes! git diff –cached (:q! to exit) Still only in your repository Put changes back up into repository Commit your staged changes in your repository git commit -m "the reason for the change" Update the respository: git push origin 9

GitGui Managing your Repositories Rescan to see changes to stage Stage changed to say you want to track those changes Click left box to unstage Sign off to start a commit message text Commit - Enter reason first Push the changes up to the repository 10

Viewing and Resetting repository See what is on the repository git remote ls to see files cd & cd.. to move around folders cat to see file contents vi to edit file contents and end with :wq Get what is on repository git pull If it says to resolve manually, just vi that file and see the head which is yours 11

Failed Push When you don't have the latest copy it will fail: 12

Recover from failed push Copy your repository elsewhere first just in case Use git bash Git pull to pull down the changes Files needing merging will have both sets of text : <<<<<<< HEAD change once not pushed ======= change once pushed >>>>>>> d43e1181ce3d7d0ca45fe0d2ce1a6120def02c37 Head is your local copy version Add --all ; commit and push again 13

Typical workflow git pull remote_repository Get changes from a remote repository and merge them into your own repository git status See what Git thinks is going on Use this frequently! Work on your files git add –-all (or just changes) git commit –m “What I did” git push 14

Helpful gitBash commands Show staged differences: git diff -- cached Show status : git status Show branches: git branch See history: git log Checkout a branch: git checkout branch Fetch so you can look but maybe not take: git fetch Pull will fetch and merge with what you have: git merge 15

Git log commands git log --pretty=oneline --max-count=2 git log --pretty=oneline --since='5 minutes ago' git log --pretty=oneline --until='5 minutes ago' git log --pretty=oneline --author= git log --pretty=oneline –all 16

Git log pretty git log --pretty=format:"%h %ad | %s%d [%an]" --graph -- date=short -- pretty="..." defines the output format. %h is the abbreviated hash of the commit %d commit decorations (e.g. branch heads or tags) %ad is the commit date %s is the comment %an is the name of the author --graph tells git to display the commit tree in the form of an ASCII graph layout --date=short keeps the date format short and nice 17

Good aliases alias gs='git status ' alias ga='git add ' alias gb='git branch ' alias gc='git commit' alias gd='git diff' alias go='git checkout ' alias gk='gitk --all&' alias gx='gitx --all' alias got='git ' alias get='git ' 18