GIT.

Slides:



Advertisements
Similar presentations
Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
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.
om om GIT - Tips & Tricks / git.dvcs git-tips.com
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
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
Fundamentals of Git By Zachary Ling 29 th, Aug,
Chapter - 2 What is “GIT” VERSION CONTROL AND GIT BASICS.
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 ?
Peter Ogden and Josh Levine.  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)
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.
1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Git Michael Backherms. What is Git? Free Software Development Tool o Speedy tool for distributed revision control and source code management Designed.
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.
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
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.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
Git Super Basics. What is Git? Version Control System (VCS) Successor to SVN in the Drupal eco-system A tool.
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.
CVS – concurrent versions system AROC Guatemala July 19-23, 2010 Guatemala City, Guatemala.
Sofia Event Center May 2014 Martin Kulov Git For TFS Developers.
Version Control System Lisa Palathingal 03/04/2015.
Intro to Git presented by Brian K. Vagnini Hosted by.
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.
CS 160 and CMPE/SE 131 Software Engineering February 16 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
An Introduction to Git David Johndrow COMP 490 – Senior Design & Development 2/11/16.
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.
Technical Presentation by: David Spano. About Git (VCS) Simple Git Commands Branching Github Git GUI Summary.
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 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Version Control Jose Caraballo. What is version Control?
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.
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
Dr. Tanusri Bhattacharya
CS5220 Advanced Topics in Web Programming Version Control with Git
Introduction to Version Control with Git
4 Version control (part 1)
Primož Gabrijelčič Git for Programmers Primož Gabrijelčič
Version Control Systems
11 Version control (part 2)
CReSIS Git Tutorial.
Git Practice walkthrough.
SSE2034: System Software Experiment 3 Spring 2016
Version Control System using Git
Development and Deployment
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
The Big Picture
SIG: Open Week 1: GitHub Tim Choh.
Version control with Git
Introduction to Version Control with Git
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
Presentation transcript:

GIT

Contents Version Control System Types of Version Control Systems Distributed Version Control System Git Basics Steps to get your project into Git Three States Recording changes to the repository Checking the status of your Files Viewing Staged and Unstages changes Committing your Changes Removing Files Moving Files Viewing the commit History Changing your last commit Unstaging and Unmodifying Working with remotes Branching Merging Rebasing

Version Control System Version control is a system that records changes to a file or set of files. The following are the types of version control systems: Local Version Control System (Ex) RCS Centralized Version Control System (Ex) CVS, Subversion, Perforce Distributed Version Control System (Ex) Git , Mercurial, Bazaar or Darcs

Types of version control systems Distributed VCS Centralized VCS Local VCS

Distributed Version Control System Distributed version control system(DVCS) keeps track of software revisions and allows many developers to work on a given project without maintaining a connection to a common network. (Ex) Git, Mercurial, Mercurial, Bazaar

Git Basics Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. It was initially designed and developed by Linus Torvalds for linux kernel development. Now it is maintained by Junio Hamano. Every Git working directory contains a full-fledged repository with complete history and full revision tracking capabilities It is not dependent on network access or a central server.

Steps to get your project into Git There are two steps to get the project into the git. Step 1 : Cloning the existing Git repository from the server to your local git repository. Commands: git clone git://github.com/schacon/grit.git(URL) Step 2 : Import the existing project or directory into your local git repository and push into the remote git repository. git init // Create an empty Git repository or reinitialize an existing one git add *.* // Add file contents to the index git commit -m ‘ initial version’ // Record changes to the local repository git push origin master // Push the code into remote repository

Three states Three main states of a Git: Working Directory Staging Area Git Directory

Contd… Git directory - Stores the metadata and object database for your project (while cloning the repository) Working directory - Single checkout of one version of the project. The files in the directory are pulled out of the compressed database in the Git directory and placed on disk for you to edit and use. Staging area - It is a simple file, generally present in your Git directory, that stores information about what will go into your next commit.

Recording Changes to the Repository Each file in your working directory can be in one of the following two states: Tracked or Untracked File status in Life Cycle : Untracked Unmodified Modified Staged

Checking the status of Your files Command : git status Untracked Files - Files in your working directory that are not present in your last snapshot and staging area. 2. Tracked Files - Files that are present in the last snapshot The following command is used to make the file status as trackable Command : git add filename

Contd… 3. Staging Modified Files – A File which is already tracked and has been modified in the working directory, but not yet staged. 4. Unstaging Modified Files - A File that is out of the staging area. The following command is used to make the file unstaged Command : git reset HEAD filename

Viewing Your Staged and Unstaged Changes To view the difference between staged and unstaged files Command : git diff To view the difference between staged and the last committed file Command : git diff –cached Note : git diff does not show the difference of staged and the last committed file

Commiting Your Changes The simplest way to commit is to type Command : git commit To commit along with comments Command : git commit –m “Comments” Skipping the Staging Area: To skip the staging area during commits Command: git commit –a –m “Comments”

Removing Files To remove the file Command : git rm filename To remove the file from staged area Command : git rm -- cached filename

Moving Files The metadata stored in Git does not tell you whether the file is renamed. To rename a file in Git: Command : git mv file_from file_to

Viewing the commit history To view the commit history Command : git log To view the difference introduced in each commit Command : git log p To limit the output for last two entries Command : git log p -2€

Changing Your Last Commit To change the last commit (if we forgot to add any file) Command : git commit –amend This will take the file to the staging area and use it for commit Example: git commit –m ‘comments’ // Record changes to the repository git add filename // Realize, you forgot to add the file git commit –amend // Record changes to the repository with newly added file

Unstaging and Unmodifying To make the Staged file to a Unstaged file Command : git reset HEAD filename To make the Modified file to an unmodified file Command : git checkout filename

Working with remotes To push our code to the remote server (actual git repository) Command : git push origin branchname To pull the code from the remote server (actual git repository) Command : git pull To get the newly created branches in our local repository Command : git fetch

Branching To create a branch in local repository Command : git checkout –b branchname To delete a branch in local repository Command : git branch –d branchname

Merging the branch Merging brings two lines of development together while preserving the ancestry of each commit history. Command : git merge branchname git checkout devel // Switch to devel branch in local repository git pull // Pull the latest code of devel from remote repository git merge hotfix // Merge the hotfix branch into devel branch present in the local repository git push origin devel // Merged devel branch is pushed to the remote repository

Example for Merging the branch

Rebasing the branch Rebasing unifies the lines of development by rewriting changes from the source branch so that they appear as children of the destination branch Command : git rebase branchname git checkout devel // Switch to devel branch in local repository git pull // Pull the latest code of devel from remote repository git rebase hotfix // Get the hotfix branch changes to the devel branch present in the local repository git push origin devel // Rebased devel branch is pushed to the remote repository

Example for Rebasing a branch

Thank You!!!