How To Git With The Program - Using Git for Version Control


Published on

This presentation is a practical guide to the use of a Version Control System (VCS) to keep your theme, plugin, website, or project safe. You will learn the basic concepts common to version control programs like Git, Subversion and Mercurial in both a team and individual development settings. The unique aspects and advantages of using Git will also be covered, including the social aspect of revision control provided by GitHub.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

How To Git With The Program - Using Git for Version Control

  1. 1. Introduction0 Brian Layman0 Twitter/Skype: @BrianLayman ( uɐɯʎɐ7 uɐıɹq )What I do:0 Security Reviews of Plugins & Servers0 Site Optimization0 Hacked Site Rescue0 Custom Plugin Creation0 Managed WordPress Hosting
  2. 2. What Is Git?0 More than just a Version Control System (VCS) “GitHub helps people build software together.”0 Allows you to track and undo changes.0 Allows multiple people to work on the same code at once.0 Allows you to make changes to multiple versions of a your software.0 Allows you to deploy software to multiple servers.0 Makes Code Development Social through 0 Notifications, Comments, Wiki & Graphs
  3. 3. What about CVS & SVN?0 Concurrent Versions System and SubVersioN0 Not predecessors. They are similar but not the same thing as Git0 SVN is a centralized hub/wheel approach (CVCS)0 Git (like Mercurial) is a Distributed VCS (DVCS) 0 You are working with your own copy of the repo 0 You can commit to other “servers” 0 FAST / OFFLINE / REDUNDANT0 SVN is simply not as advanced and “fakes” some of the standard VCS features.
  4. 4. Basic Terms0 Repository – Your project & its history0 Branch – A separate and unique version of your code0 Tag – Your branch/repo at a specific point in time.0 Clone (Checkout in SVN) – Make your repo local0 Add – Start Tracking another file/tree.0 Commit (Git Only) –Add your changes to your local repo.0 Push (Commit in SVN) – Add your changes to a server0 Pull (Update in SVN) – Bring in changes from a server0 Revert (Git Only) – Undo a local commit0 Checkout (Revert in SVN)- Get a specific server revision
  5. 5. Other Terms0 Snapshots – Local commits0 Remote – Any other server with the current repository0 Diff – Compare two file versions0 Conflict – When a server has a different change to a line that is changed on your local computer.0 Merge – Bring the changes from one branch into your local branch (in SVN this is called PAIN)0 Status – Shows the current state of the files0 Log – All of the recent commits - Notice commits are not named by a number but by a sha-1 hash that look like: a31e2253e16e2c154d01a70c3d7b12b4c57ea0a4
  6. 6. One Final Term: GitHub0 The most common Git repository server0 4 Days ago GitHub raise $100 Million Dollars (You’ve just gotta raise your pinky as you say that!)0 Provides a social aspect to coding 0 News Feed & history 0 Issue Tracking 0 Every Project gets a wiki 0 Commenting on commits 0 Pull requests & code submission 0 Fork tracking & usage graphs0 Watch people and project0 Private Repositories with role management
  7. 7. Basic Work Flow0 Create a Repository0 Add a readme file to the repository0 Commit the change with a comment (locally)0 Connect the repository to a remote server0 Push the change to the remote.0 Make Changes0 Commit (Repeat)0 Pull updates from the server0 Push
  8. 8. From the command linegit init(Create file README)git add READMEgit commit -m first commitgit remote add origin push -u origin master(make changes)git commit –m “Fixed spelling misttake” test.phpgit pullgit push
  9. 9. Graphical UIs0 Native GitHub Mac/Windows/Android programs0 On Windows there is SmartGit and TortoiseGit.0 Lots more: (mixed case)0 Demonstrations
  10. 10. BeanStalk App0 http://beanstalkapp.com0 Provides Git or SVN repositories0 Provides Automatic Deployment to various servers when a push is made to a specific branch0 This allows a two tier staging and production system with automatic deployment0 Incident Tracking0 Notification system (can use Google Talk)0 Demonstrations
  11. 11. Command Line Goodies0 git fetch – Shows what will come down with a pull0 git reset HEAD README – Unstage the last commit0 git checkout -- README – Revert file README0 git revert – Commit changes to undo last commits0 git commit –amend – Modify the last commit0 git blame – Determine who made a specific change
  12. 12. Questions?0 Lots of information is in the Pro Git book for free at: More Documentation: BeanStalk App/Google Talk deployment notifications: Notifications0 Cheat Sheets: 0 0
  13. 13. Thank You!Brian Layman – Brian@eHermitsInc.comA gazillion ways to reach me: 0 0 0 0 0 0 0 0