git for folk who like guis

18
Using Git An intro for folk who like GUIs

Upload: tim-osborn

Post on 15-May-2015

2.176 views

Category:

Investor Relations


2 download

DESCRIPTION

Slides from a lightning talk at WordPress Melbourne User Group. The business end was a simple demonstration of SourceTree, no commandline :)

TRANSCRIPT

Page 2: Git for folk who like GUIs

What is Git?

• Git is a flavour of Source Control Management(aka revision control, version control)

• It is an open source command line tool with many GUIs available

• Created by Linus Torvalds to maintain the Linux kernal

Page 3: Git for folk who like GUIs

Why use Version Control?

• Rollback to working version

• Extra redundant backups

• Keep dependencies updated

• Move towards collaborative coding

• Social proof: an extra point of presence(also StackExchange, StudioPress forums)

Page 4: Git for folk who like GUIs

Setting Up

• Create a repo from scratch or by cloning

• Stage files / hunks

• Commit to the repo

Page 5: Git for folk who like GUIs

The basic Git workflow

• You modify files in your working directory.

• You stage the files, adding snapshots of them to your staging area.

• You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.

http://git-scm.com/book/en/Getting-Started-Git-Basics

Page 6: Git for folk who like GUIs

Underpinnings

• Git = two 'tricks':

• Commit blob

• Move pointers (HEAD, branch)

• Theory video:Git For Ages 4 And Up

Page 7: Git for folk who like GUIs

Committing

• "…a commit's ID is a SHA-1 hash of several pieces of information: the contents of the commit, and the IDs of its parent commits."

http://think-like-a-git.net/sections/graphs-and-git/garbage-collection.html

Page 8: Git for folk who like GUIs

Branch and Merge• Testing Out Merges

• The Scout Pattern (merge on a new branch)

• The Save Point (merge on master)

• "Black Belt" (no branches)

http://think-like-a-git.net/sections/testing-out-merges.html

Page 12: Git for folk who like GUIs

Terminology• Repository / Repo: the .git filesystem which contains the project history and

settings

• Staging area / index / cache: files (or 'hunks' of code) which will be committed

• Working Copy: the directory you're working in, may not be staged or committed yet

• Hash: A checksum which acts as a unique identifier for your commit. Also guarantees file integrity.

• Commit: create a snapshot or restore point, to which you can return in future (n: the snapshot itself)

• Checkout: sync your Working Copy with the selected commit

• Clone: to download a copy of a repository

• Branch: an active line of development

• Head: a reference to the branch you're working on

• Master: the default development branch

Page 13: Git for folk who like GUIs

Terminology• Merge: to integrate changes from another branch into the

current

• Tag: a label which acts like a 'bookmark', generally used for tagging release versions.

• Rebase: funky merge.. think cherry picks & hard reset: Using 'git cherry-pick' to Simulate 'git rebase'

• Fork: to make modifications to someone else's project

• Push: send changes to a remote server

• Fetch: receive changes from a remote server

• Pull: Fetch & merge in one operation

http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html#

Page 15: Git for folk who like GUIs

Free Services

• BitBucket (free / unlimited private repos for 5 users)

• GitHub (free public repos, $7/mo 5 private repos)

Page 16: Git for folk who like GUIs

Wordpress & Git

• The WordPress core team uses SVN natively, but syncs to Git every 15 minutes, so folk who prefer Git can follow along:

https://github.com/WordPress/WordPress