Intro to Git presented by Brian K. Vagnini Hosted by.

Slides:



Advertisements
Similar presentations
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.
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
Git
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Introduction to Git and Github Joshua imtraum.com.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
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.
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.
علیرضا فراهانی استاد درس: جعفری نژاد مهر 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.
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.
Gotta get Git Chris Sherwood and Alfredo Aretxabaleta USGS Woods Hole.
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.
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.
GIT.
Lecture 2 Making Simple Commits Sign in on the attendance sheet! credit:
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
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.
Installing git In Linux: sudo apt-get install git In Windows: download it from run the setuphttp://git-scm.com/download/win.
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.
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.
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
Introduction to Git and git-svn Paul Gier Red Hat Sept. 27, 2011.
Basics of GIT for developers and system administrators
Introduction to GitHub
M.Sc. Juan Carlos Olivares Rojas
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
11 Version control (part 2)
CReSIS Git Tutorial.
Git-Github Safa Prepared for the course COP4331 – Fall 2016.
Git Practice walkthrough.
Version Control overview
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
The Big Picture
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.
Using Github.
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Introduction to Git and GitHub
Version Control with Git and GitHub
Version/revision control via git
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
Advanced Git for Beginners
Presentation transcript:

Intro to Git presented by Brian K. Vagnini Hosted by

What is version control? Local Version Control Centralized Version Control Distributed Version Control

What is Git Software that stores a snapshot of your files Everything is local to your machine Does a SHA-1 checksum and stores that for each snapshot

Three stages Modified Staged Committed

Three sections of a git project Working directory Staging area git repo

Installing git Linux - yum install git-core (or apt-get install git-core) Mac - using macports, sudo port install git-core or browse to git-scm.com/download/mac Windows - msysgit.github.com post install git config --global user.name ‘Your Name’ git config --global user.

Getting help Google Offline: git help git --help man git

Getting started 1- Existing folder with files and no version control git init git add. git commit -m “Your message here” 2- Nothing at all- Cloning an existing repo git clone or git clone

What about security? Two options: 1- Host your own server that has git on it 2- Pay github (or others) monthly and you get private repos that you can control You control who can commit to your project even in the free github accounts

Workflow 1- Ensure that you are on the CORRECT branch. (This is vital later on…) 2- Make modifications to your code. (SAVE the changes.) 3- Add the files to the staging area. 4- Commit the changes to your local repo. 5- Merge your Dev branch with your Master branch. 6- Push the changes to your remote repo.

git init fivestringbass:EJv2 brian$ touch index.htm fivestringbass:EJv2 brian$ git init Initialized empty Git repository in /Users/brian/Google Drive/Code/JavaScript/EJv2/.git/

git status fivestringbass:EJv2 brian$ git status # On branch master # Initial commit # Untracked files: # (use "git add..." to include in what will be committed) #ch2exa.js #index.htm nothing added to commit but untracked files present (use "git add" to track)

git add fivestringbass:EJv2 brian$ git add. (You can specify particular files if someone else in your team needs them, or you can use the period, which signifies adding everything in the current directory and subdirectories.)

git status (again) fivestringbass:EJv2 brian$ git status # On branch master # Initial commit # Changes to be committed: # (use "git rm --cached..." to unstage) #new file: ch2exa.js #new file: index.htm

git commit fivestringbass:EJv2 brian$ git commit -m "Initial commit. Start of project." [master (root-commit) de4ed60] Initial commit. Start of project. 2 files changed, 16 insertions(+) create mode ch2exa.js create mode index.htm

git status (yet again) fivestringbass:EJv2 brian$ git status # On branch master nothing to commit, working directory clean fivestringbass:EJv2 brian$

Wash, Rinse, and Repeat How often to commit? Whenever you make a major change.

Make changes and repeat fivestringbass:EJv2 brian$ git status # On branch master # Changes not staged for commit: # (use "git add..." to update what will be committed) # (use "git checkout --..." to discard changes in working directory) #modified: ch2exa.js no changes added to commit (use "git add" and/or "git commit -a")

How do I see my changes? 1) git log 2) use gitk --all (MAY need a separate install)

.gitignore Specifies intentional untracked files & folders that Git should ignore.DS_Store files (if using a MAC) data/ ( if you are processing data that is temporary) Can use regular expressions to specify the pattern to look for Can ignore all.php files with *.php EXCEPT you can add !index.php to have git track changes to that one php file

git revert Used to “undo” a commit. Similar to the Previous Versions feature in Windows Server. git revert SHA# or git revert HEAD git reset --soft SHA# ( resets the HEAD to the point you specify but doesn’t alter staging index or working directory) git reset --hard SHA# (very destructive- changes staging index and working directory to match the repo- all future changes are GONE!)

Remote repositories to view: git remote -v to add a remote: make directory (repo.git) on the remote git server, CD to it and type “git init --bare” then on your dev machine, cd to your folder, then type “git remote add REMOTENAME for github, it would be: git remote add github

git branch To see what branches are available: “git branch” To create a new branch: “git branch develop” To use a different branch: “git checkout develop” To create a new branch and switch to it: “git checkout -b develop To delete a branch: “git branch -d dev”

git merge (from your develop branch, in a clean state) git checkout master git merge develop git checkout develop WRITE CODE! merge conflicts (look for the >>> and <<< in the document)

Revised workflow git fetch origin master git pull origin master git checkout develop git merge master change files test and verify (The add to staging and commit to local repo steps are done here) git checkout master git merge develop code review git push origin master

git stash Saves changes to your code in progress without committing them to the repo git stash save “message” git stash list (views stash changes)

Retrieve your stash git stash pop (removes the changes from the stash) git stash apply (leaves a copy in the stash) -Deleting your stash git stash drop git stash list to confirm

Questions?

Thanks for coming!