SlideShare a Scribd company logo
1 of 58
Download to read offline
Nathaniel Schweinberg
       @nathanielks
    FightTheCurrent.org
What the git?
git is a Source Control
Management application
   It keeps track of your code!
git stores only the changes
         you make
git allows you to focus
on the feature you’re
        writing
http://hades.name/blog/2010/01/22/git-your-friend-not-foe-vol-2-branches/
git allows multiple developers to
    work on the same project
http://git-scm.com/about/distributed
How to get started!
Step 1: Install git




      http://git-scm.com/book/en/Getting-Started-Installing-Git
Step 2: OPEN TERMINAL
Step 3: Get it set up




      http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup
How git works




          http://git-scm.com/about/staging-area
git init
Initializes a git repository
      in current folder
git add .
   Adds file . to the staging area
( . means current folder and all files inside )
git commit –m ‘initial commit’
 Commits files added to staging area
       ( -m adds commit message )
git status
Shows current status of
  working directory
http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository
BRANCHING
Branching encourages
     a few things
Frictionless Context Switching
   Feature Based Workflow
 Disposable Experimentation



                            http://git-scm.com/about
git branch name
Create new branch to work from
git checkout branchname
 Sets working tree to branchname
git checkout –b branchname
Create and checkout into branchname
git merge branchname
Merges committed changes made in
 branchname with current branch
Repositories!
Let’s add a remote repository
Two basic actions
    git push              git pull
Pushes changes to    Pulls changes from
   remote repo          remote repo
Let’s integrate with
   WordPress!
git clone
Use git clone to duplicate
a remote repository locally
Submodules!
  Submodules allow you to keep separate
sections of your code under source control
            ( repos within repos )
git submodule add
         repository
      path/to/location
Adds submodule located at repository to
    path/to/location within project
.gitignore
Use .gitignore to prevent files
from being added to the repo
Let’s Talk strategy
Commit early,
Commit Often
Use descriptive commit
     messages!
Master branch is stable
       ONLY.
Always develop on a separate branch
Branch naming:
initials/feature-name
    ns/some-cool-feature
Working with multiple
       Devs
git rebase branchname
Updates current branch with changes made
               in another
Resources:
http://bit.ly/WhatTheGit
Nathaniel Schweinberg
       @nathanielks
    FightTheCurrent.org

More Related Content

What's hot

Git tutorial
Git tutorialGit tutorial
Git tutorialmobaires
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
 
Version Control System - Git
Version Control System - GitVersion Control System - Git
Version Control System - GitCarlo Bernaschina
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitJason Byrne
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash CourseNilay Binjola
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | WorkshopAnuchit Chalothorn
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflowsArthur Shvetsov
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git BasicsSreedath N S
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_gitLuis Atencio
 
Quick and easy way to get started with Git & GitHub
Quick and easy way to get started with Git & GitHubQuick and easy way to get started with Git & GitHub
Quick and easy way to get started with Git & GitHubAshoka R K T
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagramsDilum Navanjana
 

What's hot (20)

Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git basic
Git basicGit basic
Git basic
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
Version Control System - Git
Version Control System - GitVersion Control System - Git
Version Control System - Git
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
 
Git learning
Git learningGit learning
Git learning
 
Quick and easy way to get started with Git & GitHub
Quick and easy way to get started with Git & GitHubQuick and easy way to get started with Git & GitHub
Quick and easy way to get started with Git & GitHub
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 

Similar to Git source control guide for beginners

Similar to Git source control guide for beginners (20)

Git
GitGit
Git
 
Git for developers
Git for developersGit for developers
Git for developers
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
setting up a repository using GIT
setting up a repository using GITsetting up a repository using GIT
setting up a repository using GIT
 
Git introduction
Git introductionGit introduction
Git introduction
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Git
GitGit
Git
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Git 101
Git 101Git 101
Git 101
 
Git github
Git githubGit github
Git github
 
Git slides
Git slidesGit slides
Git slides
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Git hub visualstudiocode
Git hub visualstudiocodeGit hub visualstudiocode
Git hub visualstudiocode
 
Git and Github
Git and GithubGit and Github
Git and Github
 

Git source control guide for beginners