Git Introduction.

Slides:



Advertisements
Similar presentations
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.
Advertisements

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
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,
Git. What’s Git? A British swear A Distributed Version Control System Developed in 2005 by Linus Torvalds for use on the Linux Kernel Git Logo by Jason.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
علیرضا فراهانی استاد درس: جعفری نژاد مهر 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 ?
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.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
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.
Introduction to GitHub Alex Bigazzi Dec. 4, 2013 ITS Lab GitHub Introduction1.
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.
Page 1 TBD 12/08/2014 Formation GIT Laurent Kappel Groupe SII 65, rue de Bercy Paris Tél : Fax :
Falcons Git Usage Andre Pool Version 2.0 October 2015 / Veldhoven.
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
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 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.
Git workflows: using multiple branches for parallel development SE-2800 Dr. Mark L. Hornick 1.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
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
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
CS5220 Advanced Topics in Web Programming Version Control with Git
Introduction to Version Control with Git
4 Version control (part 1)
Information Systems and Network Engineering Laboratory II
Primož Gabrijelčič Git for Programmers Primož Gabrijelčič
11 Version control (part 2)
LECTURE 2: Software Configuration Management
Git Practice walkthrough.
Version control, using Git
File Version Control System
CS5220 Advanced Topics in Web Programming Version Control with Git
Git branches and remotes
Software Engineering for Data Scientists
An introduction to version control systems with Git
SU Development Forum Introduction to Git - Save your projects!
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
An introduction to version control systems with Git
LECTURE 3: Software Configuration Management
The Big Picture
An introduction to version control systems with Git
Getting Started with Git and Bitbucket
Version control with Git
Version Control System - Git
Version control with Git
Version Control Software
Version Control with Git and GitHub
GitHub 101 Using Github and Git for Source Control
Git Fundamentals.
Git GitHub.
Introduction to The Git Version Control System
Introduction To GitHub
Introduction To GitHub
Advanced Git for Beginners
Presentation transcript:

git Introduction

Short Introduction

About Version Control Local VCS Centralized VCS Distributed VCS E.g. RCS Centralized VCS E.g. CVS, SVN Distributed VCS E.g. CVS, SVN Records deltas for each file on disk Less error prone than manually copying files to separate directories Collaboration of developers Fine-grained access control Each computer has a copy of the repository

3 Areas in git

Status of Files New file File in repo Not changed File in repo Changed Marked for commit

Status of Files git status On branch dev Your branch is up-to-date with 'mainrepo/dev'. Changes to be committed:   (use "git reset HEAD <file>..." to unstage) modified:   README.md Changes not staged for commit:   (use "git add <file>..." to update what will be committed)   (use "git checkout -- <file>..." to discard changes in working directory) modified:   LICENSE Untracked files:   (use "git add <file>..." to include in what will be committed) .project examples/MQ/9-PixelDetector/run/scripts/startFairMQEx9NewTS.sh.in examples/advanced/Tutorial3/macro/MyLog.log examples/advanced/Tutorial3/macro/PrintLinks_complete.C examples/advanced/Tutorial3/macro/PrintLinks_timeBased.C examples/advanced/Tutorial3/macro/TST.root

What has changed? git diff git diff --staged index 1a024283..b1268102 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,6 @@ echo 'treename=name_you_chose' > config/rootmanager.dat      # path: ~/fair_install/FairSoftInst      ```   -  2. Install [FairRoot](http://fairroot.gsi.de/?q=node/82)      ```bash git diff --staged diff --git a/LICENSE b/LICENSE index 5b746838..3152e29c 100644 --- a/LICENSE +++ b/LICENSE @@ -7,7 +7,6 @@ GPL text after LGPL text in this file:   Everyone is permitted to copy and distribute verbatim copies   of this license document, but changing it is not allowed.   -    This version of the GNU Lesser General Public License incorporates  the terms and conditions of version 3 of the GNU General Public  License, supplemented by the additional permissions listed below.

Committing git commit git commit -m "Short commit" # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # new file: README # modified: CONTRIBUTING.md # ~ ~ ~ ".git/COMMIT_EDITMSG" 9L, 283C git commit -m "Short commit" git commit –a -m “Skipping staging area" git commit –-amend

Branches

Initial Commit $ git add README test.rb LICENSE $ git commit -m 'The initial commit of my project'

Sequence of Commits

Branch A branch is just a pointer to a Snapshot Default branch is called ‘master‘

Branch $ git branch testing

Branch $ git checkout testing

Branch $ vim test.rb $ git commit –a –m “made a change“

Branch $ git checkout master

Branch $ vim test.rb $ git commit –a –m „made other changes"

Merging

Merging $ git checkout master Switched to branch ‘master‘ $ git merge iss53 Merge made by the ‘recursive‘ strategy.

Remote Branch

Remote Branch

Remote Branch

Remote Branch

Remote Branch

Remote Branch $ git push origin <branchname> Counting objects: 24, done. Delta compression using up to 8 threads. Compressing objects: 100% (15/15), done. Writing objects: 100% (24/24), 1.91 KiB | 0 bytes/s, done. Total 24 (delta 2), reused 0 (delta 0) To https://github.com/schacon/simplegit * [new branch] serverfix -> serverfix In addition: pull request A pull request is the managed process of a git merge (usually via a webbased software tool) into a restricted repository. Use case PandaRoot (and FairRoot): The main repository of PandaRoot is restricted for writing If you want to get a new feature into PandaRoot you have to create a pull request on the gitlab server of PandaRoot  more at the end.

Rebasing

Rebasing $ git checkout experiment $ git rebase master First, rewinding head to replay your work on top of it... Applying: added staged command C4‘ does not point to C2 as C4 but to C3. It was rebased.

User/PandaRoot „origin“ PandaRootGroup/PandaRoot Local/PandaRoot User/PandaRoot „origin“ PandaRootGroup/PandaRoot „mainrepo“ Branches: dev, master Only read access to user Releases are tags to the master branches Master: Ready to build at any moment No development Only HotFix allowed No history changes allowed Dev: Inherited from latest master Development mainstream Rebased from master Clone of User/PandaRoot Actual source code plus complete copy of repository Create feature branch git checkout –b featureName mainrepo/dev Update via git fetch mainrepo Rebase via git rebase mainrepo/dev Upload changes via git push origin Fork of PandaRootGroup/PandaRoot Writeable by user Often rebase from mainrepo Branches: dev, master, feature branches Feature Branches: Each new feature gets a new branch Tracks dev branch After developm. finished  rebase from dev, pull request Local Repository MyPC Private Remote Repository pandaatfair.githost.io Restricted Remote Repository pandaatfair.githost.io

Summary Excellent description of git: https://git-scm.com/book/en/v2 Description of workflow in PandaRoot (and FairRoot) with useful use cases https://github.com/AnarManafov/GitWorkflow/blob/master/GitWorkflow.markdown