SlideShare a Scribd company logo
http://www.craftychild.com/finger-painting.htmlhttp://pixabay.com/en/cherry-sweet-cherry-red-fruit-167341/
Thinking in Git
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
1 of 70 03/21/2016 03:06 PM
Hi
Emily Dunham
edunham on irc.freenode.net
edunham@edunham.net
@qedunham
talks.edunham.net/gwo2016/git
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
2 of 70 03/21/2016 03:06 PM
Agenda
How to look at software
development
What's Git?
Essential Git concepts &
commands
GitHub
Demo!
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
3 of 70 03/21/2016 03:06 PM
Thinking about Software Development
Changing files
Some changes manual, other changes automatic
Changes for different reasons
Add feature, fix bug, test idea
Sometimes have several reasons at once, want
changes separate
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
4 of 70 03/21/2016 03:06 PM
Why version control?
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
5 of 70 03/21/2016 03:06 PM
How do you track changes?
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
6 of 70 03/21/2016 03:06 PM
Goals of Distributed Version Control
Get the same file out that you put in
Work in parallel with others
Recombine individual work into one
project
Track and quantify changes over time
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
7 of 70 03/21/2016 03:06 PM
Using Git
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
8 of 70 03/21/2016 03:06 PM
Setting Up
Tell Git who you are:
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
You'll need SSH keys later
ssh-keygen -t rsa -b 2048, or
ssh-keygen -t ecdsa
Install Git (also tk and tcl if you want the GUI)
Set preferred editor
export GIT_EDITOR=vim in ~/.bashrc or
equivalent
Pick a project to work on
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
9 of 70 03/21/2016 03:06 PM
Imagine...
You can time travel through the history of any
project!
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
10 of 70 03/21/2016 03:06 PM
What's a repository?
Database of snapshots of your code
Universe whose history you can travel through
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
11 of 70 03/21/2016 03:06 PM
Getting a repo
$ git init # Make a brand new repo
$ git clone <git clone url> # Start with a copy of another
# git@github.com:organization/reponame.git
# https://github.com/organization/reponame.git
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
12 of 70 03/21/2016 03:06 PM
Looking at a repo
$ ls .git/
$ git show
fatal: bad default revision 'HEAD'
# To be expected with nothing in the repo
$ git show
fatal: Not a git repository (or any of the
parent directories): .git
# not in a repo
$ git log
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
13 of 70 03/21/2016 03:06 PM
Undo repository creation
Warning
This deletes your history. Only do it if you really want to
stop having a Git repo here.
$ rm -rf .git
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
14 of 70 03/21/2016 03:06 PM
Imagine...
What if you had to publish every change as soon as
you made it?
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
15 of 70 03/21/2016 03:06 PM
How Git sees your project
Unstaged | Staged | Committed
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
16 of 70 03/21/2016 03:06 PM
Imagine...
You decide exactly where time travelers are allowed
to land.
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
17 of 70 03/21/2016 03:06 PM
What're staged changes?
Think "backstage", changes "waiting in the wings"
Files or parts of files can be added or removed
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
18 of 70 03/21/2016 03:06 PM
Staging changes
$ echo "hello Great Wide Open" > foo
$ git add foo
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
19 of 70 03/21/2016 03:06 PM
Looking at staged changes
$ touch bar
$ git status
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..."
to unstage)
new file: foo
Untracked files:
(use "git add <file>..." to include
in what will be committed)
bar
$ git commit --dry-run
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
20 of 70 03/21/2016 03:06 PM
Undo?
Keeping uncommitted changes
$ git rm --cached foo
Go back to the latest committed version
$ git reset HEAD foo
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
21 of 70 03/21/2016 03:06 PM
Imagine...
Time travelers get some signs and instructions when
they arrive
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
22 of 70 03/21/2016 03:06 PM
Thinking about snapshots
Changes to a file plus pointers to
unchanged files
Each snapshot knows the state of all
tracked files
More efficient than just copying
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
23 of 70 03/21/2016 03:06 PM
What's a commit?
snapshot of changes, author, date, committer (can differ
from author), parent commit
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
24 of 70 03/21/2016 03:06 PM
Making a commit
$ git commit
$ man git-commit
-a, --all
-i, --interactive
--reset-author
--date=<date> (see DATE FORMATS in man page)
--allow-empty
--amend
-o, --only
-S, --gpg-sign
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
25 of 70 03/21/2016 03:06 PM
Looking at commits
# details on latest or specified
$ git show
# Summary of recent, or a range
$ git log
$ man gitrevisions # ranges
What about commits per file?
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
26 of 70 03/21/2016 03:06 PM
Commit display options
$ git show
$ git show --oneline
# see PRETTY FORMATS section of
$ man git-show
# Check the GPG signature
$ git show --show-signature
# Want a GUI?
$ gitk
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
27 of 70 03/21/2016 03:06 PM
Undo?
# just one file
$ git checkout <commit> <filename>
$ git add <filename>
$ git commit -m "i put that file back how it was"
Or undo the whole commit
$ git revert <commit to revert to>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
28 of 70 03/21/2016 03:06 PM
Imagine...
Time travelers get a list of especially interesting
locations to visit
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
29 of 70 03/21/2016 03:06 PM
What's a tag?
Marker attached to a
specific commit
Typically used for version or
release number
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
30 of 70 03/21/2016 03:06 PM
Adding a Tag
$ man git-tag
$ git tag -m <msg> <tagname>
Default is lightweight tag -- just a reference for SHA-1 of
latest commit
Pass -s or -u <key-id> to GPG-sign
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
31 of 70 03/21/2016 03:06 PM
Looking at Tags
# List all available tags
$ git tag
# List tags matching regex
$ git tag -l 'regex'
# I want this version!
$ git checkout <tag name>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
32 of 70 03/21/2016 03:06 PM
Undo?
$ git tag -d <tagname>
# And remove it from a remote repo
$ git push origin :refs/tags/<tagname>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
33 of 70 03/21/2016 03:06 PM
Imagine...
You can work on separate sets of changes that don't
affect each other
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
34 of 70 03/21/2016 03:06 PM
What's a branch?
A parallel path of development, starting from a commit
that's in the tree
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
35 of 70 03/21/2016 03:06 PM
Making a branch
# track remote branch by default if one matches
$ git checkout -b <branchname>
# Shorthand for:
$ git branch <branchname> # create
$ git checkout <branchname> # check out
# Pushing a branch to a remote
$ git push <remotename> <branchname>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
36 of 70 03/21/2016 03:06 PM
Looking at branches
$ git branch
$ git show <branchname>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
37 of 70 03/21/2016 03:06 PM
Undo?
# delete only if fully merged
$ git branch -d
# Delete, I Don't care what I lose
$ git branch -D
# delete remote branch
$ git push <remotename> :<branchname>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
38 of 70 03/21/2016 03:06 PM
Imagine...
Someone else could work on the same repo in a
parallel universe
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
39 of 70 03/21/2016 03:06 PM
What's a remote?
Another clone of more or less the
same repo
(remember when we cloned to get a
copy?)
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
40 of 70 03/21/2016 03:06 PM
Adding a Remote
$ man git-remote
$ git remote add <name> <url>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
41 of 70 03/21/2016 03:06 PM
Looking at Remotes
$ git config -e
# OR
$ git remote show <name>
From one of my git configs...
[remote "origin"]
url = git@github.com:monte-language/monte.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "edunham"]
url = git@github.com:edunham/monte.git
fetch = +refs/heads/*:refs/remotes/edunham/*
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
42 of 70 03/21/2016 03:06 PM
Undo?
Do you prefer text editor...
$ git config -e
# delete or change remote
... or commands?
$ man git-remote
$ git remote rename <old> <new>
$ git remote remove <name>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
43 of 70 03/21/2016 03:06 PM
What's a merge?
Brings changes from one branch to another
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
44 of 70 03/21/2016 03:06 PM
Making a Merge
# Branch you're changing
$ git checkout mywork
$ git merge master
# Merge conflicts?
$ git status
On branch mywork
You have unmerged paths.
(fix conflicts and run "git commit")
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
45 of 70 03/21/2016 03:06 PM
Merge Conflicts
<<<<<<< HEAD
This content was in mywork but not master
=======
This content was in master but not mywork
>>>>>>> master
Replace all that stuff with what the content should be.
git add the file.
Check that you've got everything with git status, then
commit.
Or consider git mergetool for an interactive option.
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
46 of 70 03/21/2016 03:06 PM
Looking at Merges
$ git diff <commit before> <merge commit>
# before merging, see changes
$ git log ..otherbranch
$ git diff ...otherbranch
$ gitk ...otherbranch
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
47 of 70 03/21/2016 03:06 PM
Undo?
$ git merge abort
$ git reset --keep HEAD@{1}
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
48 of 70 03/21/2016 03:06 PM
What's a rebase?
Changing history. Means others will have to force pull.
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
49 of 70 03/21/2016 03:06 PM
Rebasing
$ git rebase -i <commit range>
HEAD~4
# last 4 commits
# Oops I forgot to pull
$ git pull --rebase
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
50 of 70 03/21/2016 03:06 PM
Looking at the rebase
# Rebase 1a20f51..147c812 onto 1a20f51
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
51 of 70 03/21/2016 03:06 PM
Undo?
I should never have done that
$ git reset --hard ORIG_HEAD
I'm stuck in a broken rebase, get me out
$ git rebase --abort
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
52 of 70 03/21/2016 03:06 PM
GitHub
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
53 of 70 03/21/2016 03:06 PM
Not Exactly Git
Less distributed paradigm
Git never told us who to trust
Git doesn't care who you are
Watch Linus's talk for more detail
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
54 of 70 03/21/2016 03:06 PM
Getting Started
https://github.com/join
Use the same email as your git config
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
55 of 70 03/21/2016 03:06 PM
HTTP vs SSH Clones
Permission denied (publickey).
fatal: Could not read from remote
repository.
Please make sure you have the
correct access rights and the
repository exists.
HTTP clone prompts for username and password
SSH clone uses key from your account
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
56 of 70 03/21/2016 03:06 PM
Forking
Parallel repos (or possibly divergent)
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
57 of 70 03/21/2016 03:06 PM
Pull Requests
Formalizes "Hi, please merge my changes"
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
58 of 70 03/21/2016 03:06 PM
Annoying Tricks
Branches keep adding their content to PRs
Group management and access rights
No project license required
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
59 of 70 03/21/2016 03:06 PM
Extra Features
Wiki
Gist
Issue trackers
Graphs
Repo descriptions and automatic README display
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
60 of 70 03/21/2016 03:06 PM
Additional GitHub tricks
.github/CONTRIBUTING.md
.github/ISSUE_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE.md
README
Display test results on PRs
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
61 of 70 03/21/2016 03:06 PM
Continuous Integration
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
62 of 70 03/21/2016 03:06 PM
Playing Well With Others
Change history locally, never globally
Never force push (unless you have to)
Focused commits with clear commit messages
Follow project standards for branching, tagging, etc.
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
63 of 70 03/21/2016 03:06 PM
Questions?
Emily Dunham
edunham on irc.freenode.net
edunham@edunham.net
@qedunham
talks.edunham.net/gwo2016/git
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
64 of 70 03/21/2016 03:06 PM
Other Stuff
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
65 of 70 03/21/2016 03:06 PM
checkout
$ git checkout branch
point HEAD at the tip of the specified branch
$ git checkout <revision> file
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
66 of 70 03/21/2016 03:06 PM
gitrevisions
$ man gitrevisions
Commit hash
Refname
HEAD^n is nth parent of tip of current branch
branchname~n is nth generation ancestor of that
branch
Regex on commit message * :/broken
revision:path
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
67 of 70 03/21/2016 03:06 PM
git bisect
Binary Search:
git bisect start
git bisect bad <commit>
git bisect good <commit>
git bisect next
git bisect reset <commit>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
68 of 70 03/21/2016 03:06 PM
git cherry-pick
$ git checkout <branch that needs special commit>
$ git cherry-pick <special commit from another branch>
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
69 of 70 03/21/2016 03:06 PM
git format-patch
$ git format-patch origin/master
0001-first-commit.patch
0002-second-commit.patch
# I wonder what this patch does
$ git apply --stat 0001-first-commit.patch
# Let's merge!
$ git apply 0001-first-commit.patch
# Does your project use signed-off-by?
$ git am --signoff < 0001-first-commit.patch
Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1
70 of 70 03/21/2016 03:06 PM
Ad

More Related Content

What's hot (10)

Git Real
Git RealGit Real
Git Real
Gong Haibing
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
SeongJae Park
 
Loading...git
Loading...gitLoading...git
Loading...git
Rafael García
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
BADR
 
Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
 
First time sprinters workshop: Drupalcon Barcelona 2015
First time sprinters workshop: Drupalcon Barcelona 2015First time sprinters workshop: Drupalcon Barcelona 2015
First time sprinters workshop: Drupalcon Barcelona 2015
realityloop
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCS
SeongJae Park
 
SearchLove London 2019 - Will Critchlow - Misunderstood Concepts at the Heart...
SearchLove London 2019 - Will Critchlow - Misunderstood Concepts at the Heart...SearchLove London 2019 - Will Critchlow - Misunderstood Concepts at the Heart...
SearchLove London 2019 - Will Critchlow - Misunderstood Concepts at the Heart...
Distilled
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
Becky Todd
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
Zakaria Bouazza
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
SeongJae Park
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
BADR
 
First time sprinters workshop: Drupalcon Barcelona 2015
First time sprinters workshop: Drupalcon Barcelona 2015First time sprinters workshop: Drupalcon Barcelona 2015
First time sprinters workshop: Drupalcon Barcelona 2015
realityloop
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCS
SeongJae Park
 
SearchLove London 2019 - Will Critchlow - Misunderstood Concepts at the Heart...
SearchLove London 2019 - Will Critchlow - Misunderstood Concepts at the Heart...SearchLove London 2019 - Will Critchlow - Misunderstood Concepts at the Heart...
SearchLove London 2019 - Will Critchlow - Misunderstood Concepts at the Heart...
Distilled
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
Becky Todd
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
Zakaria Bouazza
 

Similar to Thinking in Git (20)

Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
Rifauddin Tsalitsy
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
Dmitry Sheiko
 
Git operation 101
Git operation 101Git operation 101
Git operation 101
Kyohei Moriyama
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
Tahsin Abrar
 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
Boise Web Technologies Group
 
JAZOON'13 - Thomas Hug & Bartosz Majsak - Git Workshop -Essentials
JAZOON'13 - Thomas Hug & Bartosz Majsak - Git Workshop -EssentialsJAZOON'13 - Thomas Hug & Bartosz Majsak - Git Workshop -Essentials
JAZOON'13 - Thomas Hug & Bartosz Majsak - Git Workshop -Essentials
jazoon13
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
Alberto Leal
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
 
Tech thursdays / GIT
Tech thursdays / GITTech thursdays / GIT
Tech thursdays / GIT
Marek Prochera
 
Git the Wnderfull tool
Git the Wnderfull toolGit the Wnderfull tool
Git the Wnderfull tool
Amitoj Singh
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Working with Git
Working with GitWorking with Git
Working with Git
Pete Nicholls
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
Gaurav Kumar Garg
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
Supachai Vorrasing
 
From CVS to GIT
From CVS to GITFrom CVS to GIT
From CVS to GIT
Roc Boronat
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17
siva ram
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
Dídac Ríos
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
Rifauddin Tsalitsy
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
Dmitry Sheiko
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
Tahsin Abrar
 
JAZOON'13 - Thomas Hug & Bartosz Majsak - Git Workshop -Essentials
JAZOON'13 - Thomas Hug & Bartosz Majsak - Git Workshop -EssentialsJAZOON'13 - Thomas Hug & Bartosz Majsak - Git Workshop -Essentials
JAZOON'13 - Thomas Hug & Bartosz Majsak - Git Workshop -Essentials
jazoon13
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
 
Git the Wnderfull tool
Git the Wnderfull toolGit the Wnderfull tool
Git the Wnderfull tool
Amitoj Singh
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
Gaurav Kumar Garg
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17
siva ram
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
Dídac Ríos
 
Ad

More from Great Wide Open (20)

The Little Meetup That Could
The Little Meetup That CouldThe Little Meetup That Could
The Little Meetup That Could
Great Wide Open
 
Lightning Talk - 5 Hacks to Getting the Job of Your Dreams
Lightning Talk - 5 Hacks to Getting the Job of Your DreamsLightning Talk - 5 Hacks to Getting the Job of Your Dreams
Lightning Talk - 5 Hacks to Getting the Job of Your Dreams
Great Wide Open
 
Breaking Free from Proprietary Gravitational Pull
Breaking Free from Proprietary Gravitational PullBreaking Free from Proprietary Gravitational Pull
Breaking Free from Proprietary Gravitational Pull
Great Wide Open
 
Dealing with Unstructured Data: Scaling to Infinity
Dealing with Unstructured Data: Scaling to InfinityDealing with Unstructured Data: Scaling to Infinity
Dealing with Unstructured Data: Scaling to Infinity
Great Wide Open
 
You Don't Know Node: Quick Intro to 6 Core Features
You Don't Know Node: Quick Intro to 6 Core FeaturesYou Don't Know Node: Quick Intro to 6 Core Features
You Don't Know Node: Quick Intro to 6 Core Features
Great Wide Open
 
Hidden Features in HTTP
Hidden Features in HTTPHidden Features in HTTP
Hidden Features in HTTP
Great Wide Open
 
Using Cryptography Properly in Applications
Using Cryptography Properly in ApplicationsUsing Cryptography Properly in Applications
Using Cryptography Properly in Applications
Great Wide Open
 
Lightning Talk - Getting Students Involved In Open Source
Lightning Talk - Getting Students Involved In Open SourceLightning Talk - Getting Students Involved In Open Source
Lightning Talk - Getting Students Involved In Open Source
Great Wide Open
 
You have Selenium... Now what?
You have Selenium... Now what?You have Selenium... Now what?
You have Selenium... Now what?
Great Wide Open
 
How Constraints Cultivate Growth
How Constraints Cultivate GrowthHow Constraints Cultivate Growth
How Constraints Cultivate Growth
Great Wide Open
 
Inner Source 101
Inner Source 101Inner Source 101
Inner Source 101
Great Wide Open
 
Running MySQL on Linux
Running MySQL on LinuxRunning MySQL on Linux
Running MySQL on Linux
Great Wide Open
 
Search is the new UI
Search is the new UISearch is the new UI
Search is the new UI
Great Wide Open
 
Troubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed DebuggingTroubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed Debugging
Great Wide Open
 
The Current Messaging Landscape
The Current Messaging LandscapeThe Current Messaging Landscape
The Current Messaging Landscape
Great Wide Open
 
Apache httpd v2.4
Apache httpd v2.4Apache httpd v2.4
Apache httpd v2.4
Great Wide Open
 
Understanding Open Source Class 101
Understanding Open Source Class 101Understanding Open Source Class 101
Understanding Open Source Class 101
Great Wide Open
 
Antifragile Design
Antifragile DesignAntifragile Design
Antifragile Design
Great Wide Open
 
Elasticsearch for SQL Users
Elasticsearch for SQL UsersElasticsearch for SQL Users
Elasticsearch for SQL Users
Great Wide Open
 
Open Source Security Tools for Big Data
Open Source Security Tools for Big DataOpen Source Security Tools for Big Data
Open Source Security Tools for Big Data
Great Wide Open
 
The Little Meetup That Could
The Little Meetup That CouldThe Little Meetup That Could
The Little Meetup That Could
Great Wide Open
 
Lightning Talk - 5 Hacks to Getting the Job of Your Dreams
Lightning Talk - 5 Hacks to Getting the Job of Your DreamsLightning Talk - 5 Hacks to Getting the Job of Your Dreams
Lightning Talk - 5 Hacks to Getting the Job of Your Dreams
Great Wide Open
 
Breaking Free from Proprietary Gravitational Pull
Breaking Free from Proprietary Gravitational PullBreaking Free from Proprietary Gravitational Pull
Breaking Free from Proprietary Gravitational Pull
Great Wide Open
 
Dealing with Unstructured Data: Scaling to Infinity
Dealing with Unstructured Data: Scaling to InfinityDealing with Unstructured Data: Scaling to Infinity
Dealing with Unstructured Data: Scaling to Infinity
Great Wide Open
 
You Don't Know Node: Quick Intro to 6 Core Features
You Don't Know Node: Quick Intro to 6 Core FeaturesYou Don't Know Node: Quick Intro to 6 Core Features
You Don't Know Node: Quick Intro to 6 Core Features
Great Wide Open
 
Using Cryptography Properly in Applications
Using Cryptography Properly in ApplicationsUsing Cryptography Properly in Applications
Using Cryptography Properly in Applications
Great Wide Open
 
Lightning Talk - Getting Students Involved In Open Source
Lightning Talk - Getting Students Involved In Open SourceLightning Talk - Getting Students Involved In Open Source
Lightning Talk - Getting Students Involved In Open Source
Great Wide Open
 
You have Selenium... Now what?
You have Selenium... Now what?You have Selenium... Now what?
You have Selenium... Now what?
Great Wide Open
 
How Constraints Cultivate Growth
How Constraints Cultivate GrowthHow Constraints Cultivate Growth
How Constraints Cultivate Growth
Great Wide Open
 
Troubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed DebuggingTroubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed Debugging
Great Wide Open
 
The Current Messaging Landscape
The Current Messaging LandscapeThe Current Messaging Landscape
The Current Messaging Landscape
Great Wide Open
 
Understanding Open Source Class 101
Understanding Open Source Class 101Understanding Open Source Class 101
Understanding Open Source Class 101
Great Wide Open
 
Elasticsearch for SQL Users
Elasticsearch for SQL UsersElasticsearch for SQL Users
Elasticsearch for SQL Users
Great Wide Open
 
Open Source Security Tools for Big Data
Open Source Security Tools for Big DataOpen Source Security Tools for Big Data
Open Source Security Tools for Big Data
Great Wide Open
 
Ad

Recently uploaded (20)

UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 

Thinking in Git

  • 1. http://www.craftychild.com/finger-painting.htmlhttp://pixabay.com/en/cherry-sweet-cherry-red-fruit-167341/ Thinking in Git Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 1 of 70 03/21/2016 03:06 PM
  • 2. Hi Emily Dunham edunham on irc.freenode.net [email protected] @qedunham talks.edunham.net/gwo2016/git Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 2 of 70 03/21/2016 03:06 PM
  • 3. Agenda How to look at software development What's Git? Essential Git concepts & commands GitHub Demo! Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 3 of 70 03/21/2016 03:06 PM
  • 4. Thinking about Software Development Changing files Some changes manual, other changes automatic Changes for different reasons Add feature, fix bug, test idea Sometimes have several reasons at once, want changes separate Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 4 of 70 03/21/2016 03:06 PM
  • 5. Why version control? Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 5 of 70 03/21/2016 03:06 PM
  • 6. How do you track changes? Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 6 of 70 03/21/2016 03:06 PM
  • 7. Goals of Distributed Version Control Get the same file out that you put in Work in parallel with others Recombine individual work into one project Track and quantify changes over time Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 7 of 70 03/21/2016 03:06 PM
  • 8. Using Git Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 8 of 70 03/21/2016 03:06 PM
  • 9. Setting Up Tell Git who you are: $ git config --global user.name "John Doe" $ git config --global user.email [email protected] You'll need SSH keys later ssh-keygen -t rsa -b 2048, or ssh-keygen -t ecdsa Install Git (also tk and tcl if you want the GUI) Set preferred editor export GIT_EDITOR=vim in ~/.bashrc or equivalent Pick a project to work on Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 9 of 70 03/21/2016 03:06 PM
  • 10. Imagine... You can time travel through the history of any project! Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 10 of 70 03/21/2016 03:06 PM
  • 11. What's a repository? Database of snapshots of your code Universe whose history you can travel through Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 11 of 70 03/21/2016 03:06 PM
  • 12. Getting a repo $ git init # Make a brand new repo $ git clone <git clone url> # Start with a copy of another # [email protected]:organization/reponame.git # https://github.com/organization/reponame.git Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 12 of 70 03/21/2016 03:06 PM
  • 13. Looking at a repo $ ls .git/ $ git show fatal: bad default revision 'HEAD' # To be expected with nothing in the repo $ git show fatal: Not a git repository (or any of the parent directories): .git # not in a repo $ git log Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 13 of 70 03/21/2016 03:06 PM
  • 14. Undo repository creation Warning This deletes your history. Only do it if you really want to stop having a Git repo here. $ rm -rf .git Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 14 of 70 03/21/2016 03:06 PM
  • 15. Imagine... What if you had to publish every change as soon as you made it? Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 15 of 70 03/21/2016 03:06 PM
  • 16. How Git sees your project Unstaged | Staged | Committed Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 16 of 70 03/21/2016 03:06 PM
  • 17. Imagine... You decide exactly where time travelers are allowed to land. Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 17 of 70 03/21/2016 03:06 PM
  • 18. What're staged changes? Think "backstage", changes "waiting in the wings" Files or parts of files can be added or removed Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 18 of 70 03/21/2016 03:06 PM
  • 19. Staging changes $ echo "hello Great Wide Open" > foo $ git add foo Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 19 of 70 03/21/2016 03:06 PM
  • 20. Looking at staged changes $ touch bar $ git status On branch master Initial commit Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: foo Untracked files: (use "git add <file>..." to include in what will be committed) bar $ git commit --dry-run Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 20 of 70 03/21/2016 03:06 PM
  • 21. Undo? Keeping uncommitted changes $ git rm --cached foo Go back to the latest committed version $ git reset HEAD foo Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 21 of 70 03/21/2016 03:06 PM
  • 22. Imagine... Time travelers get some signs and instructions when they arrive Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 22 of 70 03/21/2016 03:06 PM
  • 23. Thinking about snapshots Changes to a file plus pointers to unchanged files Each snapshot knows the state of all tracked files More efficient than just copying Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 23 of 70 03/21/2016 03:06 PM
  • 24. What's a commit? snapshot of changes, author, date, committer (can differ from author), parent commit Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 24 of 70 03/21/2016 03:06 PM
  • 25. Making a commit $ git commit $ man git-commit -a, --all -i, --interactive --reset-author --date=<date> (see DATE FORMATS in man page) --allow-empty --amend -o, --only -S, --gpg-sign Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 25 of 70 03/21/2016 03:06 PM
  • 26. Looking at commits # details on latest or specified $ git show # Summary of recent, or a range $ git log $ man gitrevisions # ranges What about commits per file? Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 26 of 70 03/21/2016 03:06 PM
  • 27. Commit display options $ git show $ git show --oneline # see PRETTY FORMATS section of $ man git-show # Check the GPG signature $ git show --show-signature # Want a GUI? $ gitk Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 27 of 70 03/21/2016 03:06 PM
  • 28. Undo? # just one file $ git checkout <commit> <filename> $ git add <filename> $ git commit -m "i put that file back how it was" Or undo the whole commit $ git revert <commit to revert to> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 28 of 70 03/21/2016 03:06 PM
  • 29. Imagine... Time travelers get a list of especially interesting locations to visit Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 29 of 70 03/21/2016 03:06 PM
  • 30. What's a tag? Marker attached to a specific commit Typically used for version or release number Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 30 of 70 03/21/2016 03:06 PM
  • 31. Adding a Tag $ man git-tag $ git tag -m <msg> <tagname> Default is lightweight tag -- just a reference for SHA-1 of latest commit Pass -s or -u <key-id> to GPG-sign Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 31 of 70 03/21/2016 03:06 PM
  • 32. Looking at Tags # List all available tags $ git tag # List tags matching regex $ git tag -l 'regex' # I want this version! $ git checkout <tag name> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 32 of 70 03/21/2016 03:06 PM
  • 33. Undo? $ git tag -d <tagname> # And remove it from a remote repo $ git push origin :refs/tags/<tagname> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 33 of 70 03/21/2016 03:06 PM
  • 34. Imagine... You can work on separate sets of changes that don't affect each other Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 34 of 70 03/21/2016 03:06 PM
  • 35. What's a branch? A parallel path of development, starting from a commit that's in the tree Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 35 of 70 03/21/2016 03:06 PM
  • 36. Making a branch # track remote branch by default if one matches $ git checkout -b <branchname> # Shorthand for: $ git branch <branchname> # create $ git checkout <branchname> # check out # Pushing a branch to a remote $ git push <remotename> <branchname> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 36 of 70 03/21/2016 03:06 PM
  • 37. Looking at branches $ git branch $ git show <branchname> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 37 of 70 03/21/2016 03:06 PM
  • 38. Undo? # delete only if fully merged $ git branch -d # Delete, I Don't care what I lose $ git branch -D # delete remote branch $ git push <remotename> :<branchname> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 38 of 70 03/21/2016 03:06 PM
  • 39. Imagine... Someone else could work on the same repo in a parallel universe Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 39 of 70 03/21/2016 03:06 PM
  • 40. What's a remote? Another clone of more or less the same repo (remember when we cloned to get a copy?) Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 40 of 70 03/21/2016 03:06 PM
  • 41. Adding a Remote $ man git-remote $ git remote add <name> <url> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 41 of 70 03/21/2016 03:06 PM
  • 42. Looking at Remotes $ git config -e # OR $ git remote show <name> From one of my git configs... [remote "origin"] url = [email protected]:monte-language/monte.git fetch = +refs/heads/*:refs/remotes/origin/* [remote "edunham"] url = [email protected]:edunham/monte.git fetch = +refs/heads/*:refs/remotes/edunham/* Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 42 of 70 03/21/2016 03:06 PM
  • 43. Undo? Do you prefer text editor... $ git config -e # delete or change remote ... or commands? $ man git-remote $ git remote rename <old> <new> $ git remote remove <name> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 43 of 70 03/21/2016 03:06 PM
  • 44. What's a merge? Brings changes from one branch to another Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 44 of 70 03/21/2016 03:06 PM
  • 45. Making a Merge # Branch you're changing $ git checkout mywork $ git merge master # Merge conflicts? $ git status On branch mywork You have unmerged paths. (fix conflicts and run "git commit") Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 45 of 70 03/21/2016 03:06 PM
  • 46. Merge Conflicts <<<<<<< HEAD This content was in mywork but not master ======= This content was in master but not mywork >>>>>>> master Replace all that stuff with what the content should be. git add the file. Check that you've got everything with git status, then commit. Or consider git mergetool for an interactive option. Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 46 of 70 03/21/2016 03:06 PM
  • 47. Looking at Merges $ git diff <commit before> <merge commit> # before merging, see changes $ git log ..otherbranch $ git diff ...otherbranch $ gitk ...otherbranch Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 47 of 70 03/21/2016 03:06 PM
  • 48. Undo? $ git merge abort $ git reset --keep HEAD@{1} Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 48 of 70 03/21/2016 03:06 PM
  • 49. What's a rebase? Changing history. Means others will have to force pull. Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 49 of 70 03/21/2016 03:06 PM
  • 50. Rebasing $ git rebase -i <commit range> HEAD~4 # last 4 commits # Oops I forgot to pull $ git pull --rebase Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 50 of 70 03/21/2016 03:06 PM
  • 51. Looking at the rebase # Rebase 1a20f51..147c812 onto 1a20f51 # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # # These lines can be re-ordered; they are executed from top to bottom. # # If you remove a line here THAT COMMIT WILL BE LOST. Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 51 of 70 03/21/2016 03:06 PM
  • 52. Undo? I should never have done that $ git reset --hard ORIG_HEAD I'm stuck in a broken rebase, get me out $ git rebase --abort Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 52 of 70 03/21/2016 03:06 PM
  • 53. GitHub Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 53 of 70 03/21/2016 03:06 PM
  • 54. Not Exactly Git Less distributed paradigm Git never told us who to trust Git doesn't care who you are Watch Linus's talk for more detail Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 54 of 70 03/21/2016 03:06 PM
  • 55. Getting Started https://github.com/join Use the same email as your git config Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 55 of 70 03/21/2016 03:06 PM
  • 56. HTTP vs SSH Clones Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. HTTP clone prompts for username and password SSH clone uses key from your account Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 56 of 70 03/21/2016 03:06 PM
  • 57. Forking Parallel repos (or possibly divergent) Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 57 of 70 03/21/2016 03:06 PM
  • 58. Pull Requests Formalizes "Hi, please merge my changes" Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 58 of 70 03/21/2016 03:06 PM
  • 59. Annoying Tricks Branches keep adding their content to PRs Group management and access rights No project license required Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 59 of 70 03/21/2016 03:06 PM
  • 60. Extra Features Wiki Gist Issue trackers Graphs Repo descriptions and automatic README display Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 60 of 70 03/21/2016 03:06 PM
  • 61. Additional GitHub tricks .github/CONTRIBUTING.md .github/ISSUE_TEMPLATE.md .github/PULL_REQUEST_TEMPLATE.md README Display test results on PRs Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 61 of 70 03/21/2016 03:06 PM
  • 62. Continuous Integration Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 62 of 70 03/21/2016 03:06 PM
  • 63. Playing Well With Others Change history locally, never globally Never force push (unless you have to) Focused commits with clear commit messages Follow project standards for branching, tagging, etc. Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 63 of 70 03/21/2016 03:06 PM
  • 64. Questions? Emily Dunham edunham on irc.freenode.net [email protected] @qedunham talks.edunham.net/gwo2016/git Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 64 of 70 03/21/2016 03:06 PM
  • 65. Other Stuff Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 65 of 70 03/21/2016 03:06 PM
  • 66. checkout $ git checkout branch point HEAD at the tip of the specified branch $ git checkout <revision> file Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 66 of 70 03/21/2016 03:06 PM
  • 67. gitrevisions $ man gitrevisions Commit hash Refname HEAD^n is nth parent of tip of current branch branchname~n is nth generation ancestor of that branch Regex on commit message * :/broken revision:path Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 67 of 70 03/21/2016 03:06 PM
  • 68. git bisect Binary Search: git bisect start git bisect bad <commit> git bisect good <commit> git bisect next git bisect reset <commit> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 68 of 70 03/21/2016 03:06 PM
  • 69. git cherry-pick $ git checkout <branch that needs special commit> $ git cherry-pick <special commit from another branch> Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 69 of 70 03/21/2016 03:06 PM
  • 70. git format-patch $ git format-patch origin/master 0001-first-commit.patch 0002-second-commit.patch # I wonder what this patch does $ git apply --stat 0001-first-commit.patch # Let's merge! $ git apply 0001-first-commit.patch # Does your project use signed-off-by? $ git am --signoff < 0001-first-commit.patch Thinking in Git — Thinking in Git documentation http://talks.edunham.net/gwo2016/git/slides/#1 70 of 70 03/21/2016 03:06 PM