علیرضا فراهانی استاد درس: جعفری نژاد مهر 1393. Version Control ▪Version control is a system that records changes to a file or set of files over time so.

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
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,
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.
Chapter - 2 What is “GIT” VERSION CONTROL AND GIT BASICS.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
Version control with Github August 26th, 2014 Daniel Schreij VU Cognitive Psychology departement
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.
…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.
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.
Git Basics. Git stores data as snapshots of the project over time When commit Save all the files If files have not changed, point to the previous identical.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
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.
Sofia Event Center May 2014 Martin Kulov Git For TFS Developers.
Version Control System Lisa Palathingal 03/04/2015.
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.
CS 160 and CMPE/SE 131 Software Engineering February 16 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
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 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
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.
Dr. Tanusri Bhattacharya
Basics of GIT for developers and system administrators
CS5220 Advanced Topics in Web Programming Version Control with Git
Introduction to Version Control with Git
M.Sc. Juan Carlos Olivares Rojas
Version Control Systems
11 Version control (part 2)
CReSIS Git Tutorial.
Git-Github Safa Prepared for the course COP4331 – Fall 2016.
LECTURE 2: Software Configuration Management
Version control with Git
An introduction to version control systems with Git
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
An introduction to version control systems with Git
Version Control with git
LECTURE 3: Software Configuration Management
Introduction to Configuration Management
SIG: Open Week 1: GitHub Tim Choh.
An introduction to version control systems with Git
Git-Github Tools Prepared for COP4331. Git-Github Tools Prepared for COP4331.
Version control with Git
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Introduction to Version Control with Git
Introduction to Git and GitHub
Version Control with Git and GitHub
Git GitHub.
Introduction to The Git Version Control System
Presentation transcript:

علیرضا فراهانی استاد درس: جعفری نژاد مهر 1393

Version Control ▪Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. ▪Why? –Revert files back to a previous state –Compare changes over time –see who last modified something –Generally, if you screw things up or lose files, you can easily recover

Local, Centralized, Distributed ▪Local: –Storing backup versions in hard drive (Perhaps a time- stamped directory) ▪Centralized: –need to collaborate with developers on other systems –single server that contains all the versioned files, and a number of clients that check out files from that central place –CVS, Subversion, and Perforce

CVCS (Pros & Cons) ▪Pros –Access level (admin, write, read) –Knowing what others are doing ▪Cons –Single point of failure

Local, Centralized, Distributed ▪Distributed –Every client has whole repository with its history –Git, Mercurial, Bazaar

DVCS (Pros & Cons) ▪Pros –Fast –Even with server being down, every client can continue to work and save its code changes. ▪Cons –Greater redundancy

Git Vs SVN

A short history of Git

▪Linux kernel development ▪ –Changes passed around as archived file ▪ –Using a DVCS called BitKeeper ▪2005 –Relationship broke down between two comunity

A short history of Git ▪Goals –Speed – Simple design – Strong support for non-linear development (thousands of parallel branches) – Fully distributed – Able to handle large projects like the Linux kernel efficiently (speed and data size)

A short history of Git ▪Popularity –Git is now the most widely used source code management tool –33.3% of professional software developers use Git or GitHub as their primary source control system

Git Basics ▪Snapshots, not changes –a picture of what all your files look like at that moment –If a file has not changed, store a reference ▪Nearly Every Operation Is Local –Browsing the history of project –See changes between two versions

Git Basics (Cont.)

▪Git has Integrity –Everything is check-summed before it is stored and is then referred to by that checksum –40-character string (e.g. 24b9da aa493b52f8696cd6d3b00373) –Git stores everything not by file name but in the Git database addressable by the hash value of its contents ▪Git Generally Only Adds Data –very difficult to get the system to do anything that is not undoable or to make it erase data in any way

Git Basics (Cont.) ▪The Three States –Modified ▪File has changed but not committed –Staged ▪Marked to go to next commit snapshot –Committed ▪Safely stored in local database –Untracked! ▪Newly added or removed files

Git Basics (Cont.) ▪Three Main Section of a Git Project –Working Directory ▪Single checkout of one version of the project. –Staging Area ▪Simple file storing information about what will go into your next commit –Git Directory ▪What is copied when cloning a repository

Git Basics (Cont.) ▪Three Main Section of a Git Project

Git Setup ▪Installation –You’ve done it already! ▪Your identity –$ git config --global user.name "John Doe" –$ git config --global user. ▪Github distinguish you account from others by this data ▪Getting help –$ git help –$ git --helpe.g. git help commit –$ man git-

Authenticating with git servers ▪Https –You’ll be asked for your git server username and password with each remote command (pull, push,..) ▪SSH –Generate new SSH key –Add SSH key to Git server

Using Git ▪Initializing new repository –git init ▪Staging untracked files –Git add ▪Git add README.md ▪Git add. ▪Git add src/ ▪Git add *.java

Using Git (Cont.) ▪Clone a repo –git clone ▪git clone git://github.com/schacon/grit.git ▪git clone ssh://github.com/schacon/grit.git ▪Checking the Status of Your Files –git status

Using Git (Cont.) –Git status ▪Shows which files are in which state ▪git status –s (shorter version) ▪A file can in staged and modified state at the same time

Using Git (Cont.) ▪Ignoring files –Class of files that you don’t want Git to automatically add or even show –Log files, generated files –Solution?. gitignore

.Gitignore file ▪A specific file –My.txt ▪Ignore by file name –*.[oa](all files with either.o or.a extension) –*~(temporary files) ▪Excluding a file from extension pattern –!lib.a(do track the lib.a file) ▪Ignore by folder –gen/

Using Git (Cont.) ▪Committing your changes –must provide a message –git commit ▪git commit(launches your editor of choice) –git config --global core.editor –git commit –m ▪inline message with commit command ▪$ git commit –m “job’s done” –-a ▪automatically stage files already tracked before ▪git commit –am “main activity finished”

Using Git (Cont.) ▪Removing files –git rm ▪removes file(s) from staging area and working directory –--cached ▪keep file on disk but not have Git track in anymore ▪removing accidentally added files ▪$ git rm log/\*.log –all files ending in “.log” which are in “log” folder

Using Git (Cont.) ▪Viewing commit history –log command ▪$ git log ▪$ git log -2 –limits number of commits shown

Using Git (Cont.) ▪Undoing things –Unmodifying a Modified File ▪git checkout -- (to last committed version) –Unstaging a Staged File ▪git reset HEAD –Reset the staging area and the working directory to match the target commit ▪Git reset –hard (deletes history) –Rolling back to a commit making it the head ▪Git revert

Git branches

Using Git (Cont.) ▪Working with remotes –Pushing to Your Remotes ▪push command –$ git push origin (e.g. master) –pulling from your remote ▪pull command –pull is fetch and then a merge –$ git pull origin –fetch and merge is better

Useful links ▪Undoing things –atlassian.com/git/tutorials/undoing-changes/git-resetatlassian.com/git/tutorials/undoing-changes/git-reset ▪git GUIs –stackoverflow.com/questions/315911/git-for- beginners-the-definitive-practical-guidestackoverflow.com/questions/315911/git-for- beginners-the-definitive-practical-guide ▪step by step guide –try.github.comtry.github.com

Useful links مدلسازي موضوعپياده‌سازينتايججمع‌بندي

با سپاس فراوان مدلسازي موضوعپياده‌سازينتايججمع‌بندي