Becoming a Git Master - Nicola Paolucci

Atlassian
AtlassianSoftware at Atlassian
#atlassian
Becoming a Git Master: 
Concepts and Techniques to convert you 
into a master of the DVCS craft 
NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
Becoming a Git Master: 
Concepts and Techniques to convert you 
into a master of the DVCS craft 
NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
Marcus Bertrand 
Tim Pettersen 
I'm George. George McFly. 
I'm your density… I mean, 
your destiny 
Stefan Saasen 
Sarah Goff Dupont
Let’s Become Git Pros!
Here you’ll learn: 
PRO ALIASES & PROMPT 
HIDING STUFF 
CONFLICT RESOLUTION TIPS 
POLISH YOUR CODE 
PREVENT TAMPERING 
PROJECT DEPENDENCIES
A pro command prompt
PRO ALIASES & PROMPT 
Everyone has their favorite, but! 
Liquid prompt is awesome 
http://bit.do/liquid-prompt
PRO ALIASES & PROMPT 
Everyone has their favorite, but! 
Liquid prompt is awesome 
http://bit.do/liquid-prompt
Crafting Awesome Aliases
Aliases are stored in 
.gitconfig
In a section prefixed: 
[alias]
PRO ALIASES & PROMPT 
Basic Alias Form 
Very simple: 
ls = log --oneline 
[vagrant@vagrant-ubuntu-trusty-64:/home/vagrant/buildstep] master ± git ls 
90aa814 Merge pull request #85 from marqu3z/master 
f1eb16b overwrite source.list 
e6b9d16 change repo before prepare task 
8bc10c0 Fix for deprecated repository 
e34d861 Link to buildpacks.txt instead 
4502635 Merge pull request #76 from elia/fix-72-no-buildpack-bundle-install 
38be796 Bundle install ain't needed against the buildpack
PRO ALIASES & PROMPT 
You can do great things with just this 
For example: amend the last commit with 
everything I have here uncommitted and new 
caa = commit -a --amend -C HEAD
You can’t pass parameters 
to simple aliases :(
Or can you?!
muahahhahahhaha 
hahahahahahahha 
hahahhahahahah!
PRO ALIASES & PROMPT 
For multiple commands or complex 
parameters use a bash function! 
You can escape to a shell with ! like this: 
my_alias = "!f() { <command> }; f”
PRO ALIASES & PROMPT 
Some useful shortcuts and variables 
More in any bash manual 
$1 - first command line parameter 
$2 - second command line parameter 
$@ - all command line parameters passed
Ma, it’s the mini-DSL 
I always wanted!
PRO ALIASES & PROMPT 
What can you do with this? 
Cool cool things, for example add a Bitbucket remote: 
git remote add $1 https://bitbucket.org/$2.git;
PRO ALIASES & PROMPT 
ra = "!f() {  
 
}; f" 
What can you do with this? 
Cool cool things, for example add a Bitbucket remote: 
git remote add $1 https://bitbucket.org/$2.git;
PRO ALIASES & PROMPT 
ra = "!f() {  
 
}; f" 
What can you do with this? 
Cool cool things, for example add a Bitbucket remote: 
git remote add $1 https://bitbucket.org/$2.git; 
git ra jsmith jsmith/prj
PRO ALIASES & PROMPT 
ra = "!f() {  
 
}; f" 
What can you do with this? 
Cool cool things, for example add a Bitbucket remote: 
git remote add $1 https://bitbucket.org/$2.git; 
git ra jsmith jsmith/prj
PRO ALIASES & PROMPT 
Get all the alias goodness on Bitbucket 
http://bit.do/git-aliases
Powers of invisibility 
© http://www.amigosdosbichos.org/
Powers of invisibility 
© http://www.amigosdosbichos.org/
Tell git which files 
or folders to ignore 
in .gitignore
What if the file is 
already committed?!
muahahhahahhaha 
hahahahahahahha 
hahahhahahahah!
POWERS OF INVISIBILITY 
Hide files from 
Different from .gitignore, it hides committed files 
git update-index --assume-unchanged <file> 
very useful with git-svn
POWERS OF INVISIBILITY 
Hide files from 
Revert it with: 
git update-index --no-assume-unchanged <file> 
remember to add --no
POWERS OF INVISIBILITY 
List assumed unchanged files 
git ls-files -v | grep ^h 
Useful as alias (see alias list from before)
Conflict Resolution Tips
Conflict Resolution Tips
What is a conflict?
PRO ALIASES & PROMPT 
A word on terminology 
What do ours and theirs mean when solving conflicts? 
Current checked 
out branch 
!!! 
--ours
PRO ALIASES & PROMPT 
A word on terminology 
What do ours and theirs mean when solving conflicts? 
Current checked 
out branch 
!!! 
--ours 
Commit coming in 
(i.e. via merge) 
!!! 
--theirs
PRO ALIASES & PROMPT 
A word on terminology 
What do ours and theirs mean when solving conflicts? 
Current checked 
out branch 
!!! 
--ours 
Commit coming in 
(i.e. via merge) 
!!! 
--theirs
PRO ALIASES & PROMPT 
Basics for easy conflict resolution 
The common commands are: 
$ git checkout --ours/--theirs <file> 
Check back out our own/their own version of the file
PRO ALIASES & PROMPT 
Basics for easy conflict resolution 
The common commands are: 
$ git checkout --ours/--theirs <file> 
Check back out our own/their own version of the file 
$ git add <file> 
Add the change to the index will resolve the conflict
PRO ALIASES & PROMPT 
Aliases for easy conflict resolution 
Add these to [alias] in .gitconfig: 
git checkout --ours $@ && git add $@;
PRO ALIASES & PROMPT 
Aliases for easy conflict resolution 
Add these to [alias] in .gitconfig: 
ours = "!f() {  
git checkout --ours $@ && git add $@; 
 
}; f"
PRO ALIASES & PROMPT 
rerere resolve! 
Reuse Recorded Resolution will help you when 
dealing with repetitive and similar merge conflicts. 
$ git config --global rerere.enabled true 
Turns it on and forget about it
PRO ALIASES & PROMPT 
Sample output rerere 
$ git add hello.rb 
$ git commit 
Recorded resolution for 'hello.rb'. 
[master 68e16e5] Merge branch 'i18n'
PRO ALIASES & PROMPT 
Sample output rerere 
$ git add hello.rb 
$ git commit 
Recorded resolution for 'hello.rb'. 
[master 68e16e5] Merge branch 'i18n' 
Auto-merging hello.rb 
CONFLICT (content): Merge conflict in hello.rb 
Resolved 'hello.rb' using previous resolution.
Cover your tracks (aka polish your code)
Cover your tracks (aka polish your code)
POLISH YOUR CODE 
What is a rebase? 
It’s a way to replay commits, one by one, 
on top of a branch 
MASTER 
FEATURE
POLISH YOUR CODE 
What is a rebase? 
It’s a way to replay commits, one by one, 
on top of a branch 
MASTER 
FEATURE
POLISH YOUR CODE 
What is a rebase? 
It’s a way to replay commits, one by one, 
on top of a branch 
MASTER 
FEATURE
POLISH YOUR CODE 
What is a rebase? 
It’s a way to replay commits, one by one, 
on top of a branch 
MASTER 
FEATURE
POLISH YOUR CODE 
What is a rebase? 
It’s a way to replay commits, one by one, 
on top of a branch 
MASTER 
FEATURE 
Don’t use!
POLISH YOUR CODE 
What is a rebase? 
Correct way to use rebase to update a 
feature branch 
MASTER 
FEATURE
POLISH YOUR CODE 
What is a rebase? 
Correct way to use rebase to update a 
feature branch 
MASTER 
FEATURE
POLISH YOUR CODE 
What is an --interactive rebase? 
It’s a way to replay commits, one by one, 
deciding interactively what to do with each 
PICK! 
SQUASH 
REWORD! 
FIXUP 
EDIT ! 
EXEC
POLISH YOUR CODE 
--autosquash 
Automatically modify the todo list of 
rebase --interactive by annotating commits 
$ git config --global rebase.autosquash true 
Turns on the feature
POLISH YOUR CODE 
--autosquash 
You can prepend commit messages with: 
git commit -m “squash! …" 
git commit -m “fixup! …" 
git commit -m “reword! …" 
etc… 
Rebase task list will be then prepopulated
CUSTOMARY 
WARNING! 
rebase rewrites history! 
Treat this power with great care. 
Only rewrite history of local branches or…
Prevent tampering
Always a balancing act 
Security DevSpeed
PREVENT TAMPERING 
Lock down your repo 
Edit .git/config in the [receive] section: 
# no rewriting history 
denyNonFastForwards = true 
! 
# no deleting history 
denyDeletes = true 
! 
# check object consistency 
fsckObjects = true
Reject force push, 
Luke 
Git project has already an update hook 
‘update-paranoid’ that is designed to 
reject history rewriting updates 
http://bit.do/update-paranoid
Reject force push,Luke
Reject force push,Luke
PREVENT TAMPERING 
Impersonating Authors is easy 
with 
$ git commit -m "I'm Luke" 
$ git commit --author "Elvis <elvis@graceland.net>" -m "I'm elvis" 
commit a9f0967cba236465d6cb68247.. 
Author: Elvis <elvis@graceland.net> 
Date: Mon Apr 22 18:06:35 2013 -0500 
! 
I'm Elvis 
! 
commit d6eb7572cbb4bdd8e2aaa5c90.. 
Author: Luke <luke@tatooine.com> 
Date: Mon Apr 22 18:04:54 2013 -0500 
! 
I'm Luke
PREVENT TAMPERING 
Finally you can sign/verify tags 
git tag -s <tag_name> -m “message” 
Sign a tag with your GPG key 
git tag -v <tag_name> 
Verifies that the signature is valid
Signing release tags is often 
all you need
PREVENT TAMPERING 
Aside on GPG 
The GNU Privacy Guard 
GnuPG allows to encrypt and sign your data and 
communication, features a versatile key management system.
PREVENT TAMPERING 
Harden up by signing things 
Sample gpg commands to get you started:
PREVENT TAMPERING 
Harden up by signing things 
Sample gpg commands to get you started: 
gpg --gen-key 
Generate your GPG keys
PREVENT TAMPERING 
Harden up by signing things 
Sample gpg commands to get you started: 
gpg --gen-key 
Generate your GPG keys 
gpg -k 
List your keys
PREVENT TAMPERING 
Harden up by signing things 
Sample gpg commands to get you started: 
gpg --gen-key 
Generate your GPG keys 
gpg -k 
List your keys 
gpg -a --export <keyid> 
Export your key
PREVENT TAMPERING 
Hide files in raw objects 
The way the Linux kernel hackers do it 
git hash-object -w <file>
PREVENT TAMPERING 
Hide files in raw objects 
The way the Linux kernel hackers do it 
actually writes into the object db 
git hash-object -w <file>
PREVENT TAMPERING 
Hide files in raw objects 
The way the Linux kernel hackers do it 
actually writes into the object db 
git hash-object -w <file> 
Remember to associate a tag to 
it or it will be garbage collected
PREVENT TAMPERING 
Store your signature in 
Simple! Add a tag referencing your public key 
gpg -a --export <keyid> |  
git hash-object -w --stdin 
Store your public key in a raw object
PREVENT TAMPERING 
Store your signature in 
Simple! Add a tag referencing your public key 
gpg -a --export <keyid> |  
git hash-object -w --stdin 
Store your public key in a raw object 
git tag nicks-key 65704f3… 
Tag the raw object with a label
PREVENT TAMPERING 
Store your signature in 
Simple! Add a tag referencing your public key 
gpg -a --export <keyid> |  
git hash-object -w --stdin 
Store your public key in a raw object 
git tag nicks-key 65704f3… 
Tag the raw object with a label 
raw object id
PREVENT TAMPERING 
Import other public keys 
git cat-file -p tims-key | gpg --import 
Import a GPG key from a tag
PREVENT TAMPERING 
Finally you can sign/verify tags 
git tag -s <tag_name> -m “message” 
Sign a tag with your GPG key 
git tag -v <tag_name> 
Verifies that the signature is valid
and Project Dependencies
How do you handle 
project dependencies 
with ?
Splitting up a project 
is painful, for so many 
reasons
Use a build/dependency 
tool instead of
GIT AND PROJECT DEPENDENCIES 
I’ll give you an incomplete list of examples! 
Java 
Nodejs 
Javascript 
Python Pip easy-install 
Ruby
GIT AND PROJECT DEPENDENCIES 
I’ll give you an incomplete list of examples! (2) 
C# 
C++ c-make 
Objective C 
PHP 
Go godep
Another possibility: 
use git submodule
Another possibility: 
use git subtree
Use other build 
and cross-stack 
dependency tools
GIT AND PROJECT DEPENDENCIES 
For example you can check out: 
•Android Repo (http://bit.do/android-repo) 
•Repobuild (chrisvana / repobuild) 
•Chromium depot_tools (http://bit.do/depot-tools) 
•Facebook Buck (http://facebook.github.io/buck/) 
•Twitter Pants (http://bit.do/twitter-pants)
PRO ALIASES & PROMPT 
Review these ideas online 
http://bit.do/git-deps
Thank you! 
NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
POWERS OF INVISIBILITY 
Hide files from 
• Level One 
• Level Two 
• Level Two 
• Level Two 
• Level One 
CODE FONT: 
<html xmlns="http://www.w3.org/1999/xhtml">
POWERS OF INVISIBILITY 
Page title here 
• Level One 
• Level Two 
• Level Two 
• Level Two 
• Level One
Page title here 
• Level One 
• Level Two 
• Level Two 
• Level Two 
• Level One
Page title here 
Page Title Here 
• Level One 
• Level Two 
• Level Two 
• Level Two 
• Level One
Page title here 
• Level One 
• Level Two 
• Level Two 
• Level Two 
• Level One
Becoming a Git Master - Nicola Paolucci
Caption goes here
Just text by itself, 
for impact.
Just text by itself, 
for impact.
Just text by itself, 
for impact.
Just text by itself, 
for impact.
Just text by itself, 
for impact.
Type Quote Here And Move Both Quotation 
Marks To The Beginning And End Of The 
Quote. Lorem Ipsum Dolor Sit Amet, Conse 
Cetur Ading Elit. 
DAVID HANDLY, GLOBOCHEM 
” 
“
Big cool statistic 2,569 Add-Ons in Marketplace
Becoming a Git Master - Nicola Paolucci
60 
45 
30 
15 
0 
2007 2008 2009 2010 
Region 1 Region 2 Region 3 
Page title here
40% 
30% 
20% 
10% 
2007 2008 2009 2010 
Page title here
Page title here 
COLUMN TITLE COLUMN TITLE COLUMN TITLE 
Content Content 
Content Content 
Content Content 
Content Content 
Content Content
Becoming a Git Master - Nicola Paolucci
1 of 112

Recommended

Super-powered CI with Git - Sarah Goff-Dupont by
Super-powered CI with Git - Sarah Goff-DupontSuper-powered CI with Git - Sarah Goff-Dupont
Super-powered CI with Git - Sarah Goff-DupontAtlassian
3.3K views35 slides
A Business Case for Git - Tim Pettersen by
A Business Case for Git - Tim PettersenA Business Case for Git - Tim Pettersen
A Business Case for Git - Tim PettersenAtlassian
7.2K views110 slides
London Atlassian User Group - February 2014 by
London Atlassian User Group - February 2014London Atlassian User Group - February 2014
London Atlassian User Group - February 2014Steve Smith
11.4K views40 slides
Creative Branching Models for Multiple Release Streams by
Creative Branching Models for Multiple Release StreamsCreative Branching Models for Multiple Release Streams
Creative Branching Models for Multiple Release StreamsAtlassian
14.6K views55 slides
Git with t for teams by
Git with t for teamsGit with t for teams
Git with t for teamsSven Peters
70.2K views186 slides
Agile android by
Agile androidAgile android
Agile androidGodfrey Nolan
1.4K views23 slides

More Related Content

What's hot

Managing releases effectively through git by
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through gitMohd Farid
1.1K views31 slides
Git Branching for Agile Teams by
Git Branching for Agile TeamsGit Branching for Agile Teams
Git Branching for Agile TeamsSven Peters
30.5K views49 slides
Game of Codes: the Battle for CI by
Game of Codes: the Battle for CIGame of Codes: the Battle for CI
Game of Codes: the Battle for CIAtlassian
27.3K views74 slides
Continuous Integration for Spark Apps by Sean McIntyre by
Continuous Integration for Spark Apps by Sean McIntyreContinuous Integration for Spark Apps by Sean McIntyre
Continuous Integration for Spark Apps by Sean McIntyreSpark Summit
3.6K views45 slides
Code review vs pull request by
Code review vs pull requestCode review vs pull request
Code review vs pull requestBryan Liu
2.5K views33 slides
Configuration as Code in Bamboo by
Configuration as Code in BambooConfiguration as Code in Bamboo
Configuration as Code in BambooAtlassian
16.5K views39 slides

What's hot(20)

Managing releases effectively through git by Mohd Farid
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through git
Mohd Farid1.1K views
Git Branching for Agile Teams by Sven Peters
Git Branching for Agile TeamsGit Branching for Agile Teams
Git Branching for Agile Teams
Sven Peters30.5K views
Game of Codes: the Battle for CI by Atlassian
Game of Codes: the Battle for CIGame of Codes: the Battle for CI
Game of Codes: the Battle for CI
Atlassian27.3K views
Continuous Integration for Spark Apps by Sean McIntyre by Spark Summit
Continuous Integration for Spark Apps by Sean McIntyreContinuous Integration for Spark Apps by Sean McIntyre
Continuous Integration for Spark Apps by Sean McIntyre
Spark Summit3.6K views
Code review vs pull request by Bryan Liu
Code review vs pull requestCode review vs pull request
Code review vs pull request
Bryan Liu2.5K views
Configuration as Code in Bamboo by Atlassian
Configuration as Code in BambooConfiguration as Code in Bamboo
Configuration as Code in Bamboo
Atlassian16.5K views
Git workflow in agile development by Zack Siri
Git workflow in agile developmentGit workflow in agile development
Git workflow in agile development
Zack Siri1.8K views
Comparing Agile QA Approaches to End-to-End Testing by Katie Chin
Comparing Agile QA Approaches to End-to-End TestingComparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End Testing
Katie Chin2.6K views
Git Ready! Workflows by Atlassian
Git Ready! WorkflowsGit Ready! Workflows
Git Ready! Workflows
Atlassian12.3K views
GitLab 8.5 Highlights and Step-by-step tutorial by Heather McNamee
GitLab 8.5 Highlights and Step-by-step tutorialGitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorial
Heather McNamee646 views
Crossing the Continuous Delivery Chasm - J. Paul Reed by Atlassian
Crossing the Continuous Delivery Chasm - J. Paul ReedCrossing the Continuous Delivery Chasm - J. Paul Reed
Crossing the Continuous Delivery Chasm - J. Paul Reed
Atlassian1.5K views
Atlassian User Group - September 2013 by Sven Peters
Atlassian User Group - September 2013Atlassian User Group - September 2013
Atlassian User Group - September 2013
Sven Peters9.5K views
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines by Abhinav Gupta
Salesforce CI (Continuous Integration) - SFDX + Bitbucket PipelinesSalesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Abhinav Gupta3K views
Distributed Release Management by Mike Brittain
Distributed Release ManagementDistributed Release Management
Distributed Release Management
Mike Brittain11.6K views
Git and Git Workflow Models as Catalysts of Software Development by Lemi Orhan Ergin
Git and Git Workflow Models as Catalysts of Software DevelopmentGit and Git Workflow Models as Catalysts of Software Development
Git and Git Workflow Models as Catalysts of Software Development
Lemi Orhan Ergin14.2K views
Philly CocoaHeads 20160414 - Building Your App SDK With Swift by Jordan Yaker
Philly CocoaHeads 20160414 - Building Your App SDK With SwiftPhilly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
Jordan Yaker260 views
Monitoring 改造計畫:流程觀點 by William Yeh
Monitoring 改造計畫:流程觀點Monitoring 改造計畫:流程觀點
Monitoring 改造計畫:流程觀點
William Yeh2K views
Pipeline your pipelines! by Giulio Vian
Pipeline your pipelines!Pipeline your pipelines!
Pipeline your pipelines!
Giulio Vian256 views
Git workflow step by step by Binh Quan Duc
Git workflow step by stepGit workflow step by step
Git workflow step by step
Binh Quan Duc1.3K views

Viewers also liked

Spiking Your Way to Improved Agile Development - Anatoli Kazatchkov by
Spiking Your Way to Improved Agile Development - Anatoli KazatchkovSpiking Your Way to Improved Agile Development - Anatoli Kazatchkov
Spiking Your Way to Improved Agile Development - Anatoli KazatchkovAtlassian
19.5K views50 slides
Getting Into Git by
Getting Into GitGetting Into Git
Getting Into GitPete Goodliffe
1.2K views177 slides
Quality at Speed - Penny Wyatt by
Quality at Speed - Penny WyattQuality at Speed - Penny Wyatt
Quality at Speed - Penny WyattAtlassian
6.9K views42 slides
Advanced Git: Functionality and Features by
Advanced Git: Functionality and FeaturesAdvanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesBrent Laster
1K views263 slides
Governing JIRA at Scale - Jordan Dea-Mattson by
Governing JIRA at Scale - Jordan Dea-MattsonGoverning JIRA at Scale - Jordan Dea-Mattson
Governing JIRA at Scale - Jordan Dea-MattsonAtlassian
7.2K views31 slides
Git pavel grushetsky by
Git pavel grushetskyGit pavel grushetsky
Git pavel grushetskyInna Kravchenko
984 views25 slides

Viewers also liked(20)

Spiking Your Way to Improved Agile Development - Anatoli Kazatchkov by Atlassian
Spiking Your Way to Improved Agile Development - Anatoli KazatchkovSpiking Your Way to Improved Agile Development - Anatoli Kazatchkov
Spiking Your Way to Improved Agile Development - Anatoli Kazatchkov
Atlassian19.5K views
Quality at Speed - Penny Wyatt by Atlassian
Quality at Speed - Penny WyattQuality at Speed - Penny Wyatt
Quality at Speed - Penny Wyatt
Atlassian6.9K views
Advanced Git: Functionality and Features by Brent Laster
Advanced Git: Functionality and FeaturesAdvanced Git: Functionality and Features
Advanced Git: Functionality and Features
Brent Laster1K views
Governing JIRA at Scale - Jordan Dea-Mattson by Atlassian
Governing JIRA at Scale - Jordan Dea-MattsonGoverning JIRA at Scale - Jordan Dea-Mattson
Governing JIRA at Scale - Jordan Dea-Mattson
Atlassian7.2K views
The adoption of FOSS workfows in commercial software development: the case of... by dmgerman
The adoption of FOSS workfows in commercial software development: the case of...The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...
dmgerman659 views
Git case of the week4212. by Shaikhani.
Git case of the week4212.Git case of the week4212.
Git case of the week4212.
Shaikhani.359 views
Deep dark-side of git: How git works internally by SeongJae Park
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
SeongJae Park11.8K views
JIRA Performance Testing in Pictures - Edward Bukoski Michael March by Atlassian
JIRA Performance Testing in Pictures - Edward Bukoski Michael MarchJIRA Performance Testing in Pictures - Edward Bukoski Michael March
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
Atlassian10.3K views
How to Use HipChat to Collaborate and Build Culture - Matthew Weinberg by Atlassian
How to Use HipChat to Collaborate and Build Culture - Matthew WeinbergHow to Use HipChat to Collaborate and Build Culture - Matthew Weinberg
How to Use HipChat to Collaborate and Build Culture - Matthew Weinberg
Atlassian11.3K views
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff by Atlassian
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Atlassian7.5K views
HipChat (allthethings) for (alltheteams)! - Rich Manalang by Atlassian
HipChat (allthethings) for (alltheteams)! - Rich ManalangHipChat (allthethings) for (alltheteams)! - Rich Manalang
HipChat (allthethings) for (alltheteams)! - Rich Manalang
Atlassian4.7K views
Summit 2014 Keynote by Atlassian
Summit 2014 KeynoteSummit 2014 Keynote
Summit 2014 Keynote
Atlassian32.3K views
Getting Git Right by Sven Peters
Getting Git RightGetting Git Right
Getting Git Right
Sven Peters152.2K views

Similar to Becoming a Git Master - Nicola Paolucci

Version Control ThinkVitamin by
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitaminAlex Hillman
671 views84 slides
That's (g)it! par Sébastien Dawans CETIC by
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICLa FeWeb
1K views164 slides
Ninja Git: Save Your Master by
Ninja Git: Save Your MasterNinja Git: Save Your Master
Ninja Git: Save Your MasterNicola Paolucci
1.4K views53 slides
Source Code Management systems by
Source Code Management systemsSource Code Management systems
Source Code Management systemsxSawyer
8.4K views25 slides
Git Anti-Patterns: How To Mess Up With Git and Love it Again by
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainLemi Orhan Ergin
2.8K views73 slides
Git Distributed Version Control System by
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
825 views51 slides

Similar to Becoming a Git Master - Nicola Paolucci(20)

Version Control ThinkVitamin by Alex Hillman
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
Alex Hillman671 views
That's (g)it! par Sébastien Dawans CETIC by La FeWeb
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETIC
La FeWeb1K views
Source Code Management systems by xSawyer
Source Code Management systemsSource Code Management systems
Source Code Management systems
xSawyer8.4K views
Git Anti-Patterns: How To Mess Up With Git and Love it Again by Lemi Orhan Ergin
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Lemi Orhan Ergin2.8K views
Git Distributed Version Control System by Victor Wong
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong825 views
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017 by Lemi Orhan Ergin
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Lemi Orhan Ergin1.6K views
VCS for Teamwork - GIT Workshop by Anis Ahmad
VCS for Teamwork - GIT WorkshopVCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT Workshop
Anis Ahmad176 views
GTFO: Git Theory For OpenSource by Forest Mars
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSource
Forest Mars1.4K views
Github - Git Training Slides: Foundations by Lee Hanxue
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue3.1K views
Git the Docs: A fun, hands-on introduction to version control by Becky Todd
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 Todd187 views
A Quick Start - Version Control with Git by Dmitry Sheiko
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
Dmitry Sheiko1.3K views
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey... by Lemi Orhan Ergin
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Lemi Orhan Ergin5K views

More from Atlassian

International Women's Day 2020 by
International Women's Day 2020International Women's Day 2020
International Women's Day 2020Atlassian
2.5K views13 slides
10 emerging trends that will unbreak your workplace in 2020 by
10 emerging trends that will unbreak your workplace in 202010 emerging trends that will unbreak your workplace in 2020
10 emerging trends that will unbreak your workplace in 2020Atlassian
1.4K views13 slides
Forge App Showcase by
Forge App ShowcaseForge App Showcase
Forge App ShowcaseAtlassian
7.9K views13 slides
Let's Build an Editor Macro with Forge UI by
Let's Build an Editor Macro with Forge UILet's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UIAtlassian
7.7K views22 slides
Meet the Forge Runtime by
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge RuntimeAtlassian
7.6K views90 slides
Forge UI: A New Way to Customize the Atlassian User Experience by
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceAtlassian
8.4K views74 slides

More from Atlassian(20)

International Women's Day 2020 by Atlassian
International Women's Day 2020International Women's Day 2020
International Women's Day 2020
Atlassian2.5K views
10 emerging trends that will unbreak your workplace in 2020 by Atlassian
10 emerging trends that will unbreak your workplace in 202010 emerging trends that will unbreak your workplace in 2020
10 emerging trends that will unbreak your workplace in 2020
Atlassian1.4K views
Forge App Showcase by Atlassian
Forge App ShowcaseForge App Showcase
Forge App Showcase
Atlassian7.9K views
Let's Build an Editor Macro with Forge UI by Atlassian
Let's Build an Editor Macro with Forge UILet's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UI
Atlassian7.7K views
Meet the Forge Runtime by Atlassian
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge Runtime
Atlassian7.6K views
Forge UI: A New Way to Customize the Atlassian User Experience by Atlassian
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User Experience
Atlassian8.4K views
Take Action with Forge Triggers by Atlassian
Take Action with Forge TriggersTake Action with Forge Triggers
Take Action with Forge Triggers
Atlassian7.9K views
Observability and Troubleshooting in Forge by Atlassian
Observability and Troubleshooting in ForgeObservability and Troubleshooting in Forge
Observability and Troubleshooting in Forge
Atlassian7.3K views
Trusted by Default: The Forge Security & Privacy Model by Atlassian
Trusted by Default: The Forge Security & Privacy ModelTrusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy Model
Atlassian7.3K views
Designing Forge UI: A Story of Designing an App UI System by Atlassian
Designing Forge UI: A Story of Designing an App UI SystemDesigning Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI System
Atlassian7.4K views
Forge: Under the Hood by Atlassian
Forge: Under the HoodForge: Under the Hood
Forge: Under the Hood
Atlassian7.4K views
Access to User Activities - Activity Platform APIs by Atlassian
Access to User Activities - Activity Platform APIsAccess to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIs
Atlassian7.7K views
Design Your Next App with the Atlassian Vendor Sketch Plugin by Atlassian
Design Your Next App with the Atlassian Vendor Sketch PluginDesign Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch Plugin
Atlassian11.7K views
Tear Up Your Roadmap and Get Out of the Building by Atlassian
Tear Up Your Roadmap and Get Out of the BuildingTear Up Your Roadmap and Get Out of the Building
Tear Up Your Roadmap and Get Out of the Building
Atlassian2.8K views
Nailing Measurement: a Framework for Measuring Metrics that Matter by Atlassian
Nailing Measurement: a Framework for Measuring Metrics that MatterNailing Measurement: a Framework for Measuring Metrics that Matter
Nailing Measurement: a Framework for Measuring Metrics that Matter
Atlassian12K views
Building Apps With Color Blind Users in Mind by Atlassian
Building Apps With Color Blind Users in MindBuilding Apps With Color Blind Users in Mind
Building Apps With Color Blind Users in Mind
Atlassian2.9K views
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX... by Atlassian
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Atlassian2.9K views
Beyond Diversity: A Guide to Building Balanced Teams by Atlassian
Beyond Diversity: A Guide to Building Balanced TeamsBeyond Diversity: A Guide to Building Balanced Teams
Beyond Diversity: A Guide to Building Balanced Teams
Atlassian9.1K views
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team by Atlassian
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed TeamThe Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
Atlassian17.8K views
Building Apps With Enterprise in Mind by Atlassian
Building Apps With Enterprise in MindBuilding Apps With Enterprise in Mind
Building Apps With Enterprise in Mind
Atlassian9.1K views

Recently uploaded

AI and Ml presentation .pptx by
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptxFayazAli87
12 views15 slides
Ports-and-Adapters Architecture for Embedded HMI by
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIBurkhard Stubert
21 views19 slides
Generic or specific? Making sensible software design decisions by
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
6 views60 slides
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J... by
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...Deltares
12 views24 slides
Programming Field by
Programming FieldProgramming Field
Programming Fieldthehardtechnology
5 views9 slides
FOSSLight Community Day 2023-11-30 by
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30Shane Coughlan
5 views18 slides

Recently uploaded(20)

AI and Ml presentation .pptx by FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8712 views
Ports-and-Adapters Architecture for Embedded HMI by Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert21 views
Generic or specific? Making sensible software design decisions by Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J... by Deltares
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
Deltares12 views
FOSSLight Community Day 2023-11-30 by Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan5 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller41 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor23 views
Sprint 226 by ManageIQ
Sprint 226Sprint 226
Sprint 226
ManageIQ5 views
Headless JS UG Presentation.pptx by Jack Spektor
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptx
Jack Spektor8 views
FIMA 2023 Neo4j & FS - Entity Resolution.pptx by Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j8 views
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports by Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
Quality Engineer: A Day in the Life by John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino6 views
Copilot Prompting Toolkit_All Resources.pdf by Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana10 views
Advanced API Mocking Techniques by Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 views
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... by Deltares
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
Deltares7 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 views
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... by sparkfabrik
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik7 views

Becoming a Git Master - Nicola Paolucci

  • 2. Becoming a Git Master: Concepts and Techniques to convert you into a master of the DVCS craft NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
  • 3. Becoming a Git Master: Concepts and Techniques to convert you into a master of the DVCS craft NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
  • 4. Marcus Bertrand Tim Pettersen I'm George. George McFly. I'm your density… I mean, your destiny Stefan Saasen Sarah Goff Dupont
  • 6. Here you’ll learn: PRO ALIASES & PROMPT HIDING STUFF CONFLICT RESOLUTION TIPS POLISH YOUR CODE PREVENT TAMPERING PROJECT DEPENDENCIES
  • 7. A pro command prompt
  • 8. PRO ALIASES & PROMPT Everyone has their favorite, but! Liquid prompt is awesome http://bit.do/liquid-prompt
  • 9. PRO ALIASES & PROMPT Everyone has their favorite, but! Liquid prompt is awesome http://bit.do/liquid-prompt
  • 11. Aliases are stored in .gitconfig
  • 12. In a section prefixed: [alias]
  • 13. PRO ALIASES & PROMPT Basic Alias Form Very simple: ls = log --oneline [vagrant@vagrant-ubuntu-trusty-64:/home/vagrant/buildstep] master ± git ls 90aa814 Merge pull request #85 from marqu3z/master f1eb16b overwrite source.list e6b9d16 change repo before prepare task 8bc10c0 Fix for deprecated repository e34d861 Link to buildpacks.txt instead 4502635 Merge pull request #76 from elia/fix-72-no-buildpack-bundle-install 38be796 Bundle install ain't needed against the buildpack
  • 14. PRO ALIASES & PROMPT You can do great things with just this For example: amend the last commit with everything I have here uncommitted and new caa = commit -a --amend -C HEAD
  • 15. You can’t pass parameters to simple aliases :(
  • 18. PRO ALIASES & PROMPT For multiple commands or complex parameters use a bash function! You can escape to a shell with ! like this: my_alias = "!f() { <command> }; f”
  • 19. PRO ALIASES & PROMPT Some useful shortcuts and variables More in any bash manual $1 - first command line parameter $2 - second command line parameter $@ - all command line parameters passed
  • 20. Ma, it’s the mini-DSL I always wanted!
  • 21. PRO ALIASES & PROMPT What can you do with this? Cool cool things, for example add a Bitbucket remote: git remote add $1 https://bitbucket.org/$2.git;
  • 22. PRO ALIASES & PROMPT ra = "!f() { }; f" What can you do with this? Cool cool things, for example add a Bitbucket remote: git remote add $1 https://bitbucket.org/$2.git;
  • 23. PRO ALIASES & PROMPT ra = "!f() { }; f" What can you do with this? Cool cool things, for example add a Bitbucket remote: git remote add $1 https://bitbucket.org/$2.git; git ra jsmith jsmith/prj
  • 24. PRO ALIASES & PROMPT ra = "!f() { }; f" What can you do with this? Cool cool things, for example add a Bitbucket remote: git remote add $1 https://bitbucket.org/$2.git; git ra jsmith jsmith/prj
  • 25. PRO ALIASES & PROMPT Get all the alias goodness on Bitbucket http://bit.do/git-aliases
  • 26. Powers of invisibility © http://www.amigosdosbichos.org/
  • 27. Powers of invisibility © http://www.amigosdosbichos.org/
  • 28. Tell git which files or folders to ignore in .gitignore
  • 29. What if the file is already committed?!
  • 31. POWERS OF INVISIBILITY Hide files from Different from .gitignore, it hides committed files git update-index --assume-unchanged <file> very useful with git-svn
  • 32. POWERS OF INVISIBILITY Hide files from Revert it with: git update-index --no-assume-unchanged <file> remember to add --no
  • 33. POWERS OF INVISIBILITY List assumed unchanged files git ls-files -v | grep ^h Useful as alias (see alias list from before)
  • 36. What is a conflict?
  • 37. PRO ALIASES & PROMPT A word on terminology What do ours and theirs mean when solving conflicts? Current checked out branch !!! --ours
  • 38. PRO ALIASES & PROMPT A word on terminology What do ours and theirs mean when solving conflicts? Current checked out branch !!! --ours Commit coming in (i.e. via merge) !!! --theirs
  • 39. PRO ALIASES & PROMPT A word on terminology What do ours and theirs mean when solving conflicts? Current checked out branch !!! --ours Commit coming in (i.e. via merge) !!! --theirs
  • 40. PRO ALIASES & PROMPT Basics for easy conflict resolution The common commands are: $ git checkout --ours/--theirs <file> Check back out our own/their own version of the file
  • 41. PRO ALIASES & PROMPT Basics for easy conflict resolution The common commands are: $ git checkout --ours/--theirs <file> Check back out our own/their own version of the file $ git add <file> Add the change to the index will resolve the conflict
  • 42. PRO ALIASES & PROMPT Aliases for easy conflict resolution Add these to [alias] in .gitconfig: git checkout --ours $@ && git add $@;
  • 43. PRO ALIASES & PROMPT Aliases for easy conflict resolution Add these to [alias] in .gitconfig: ours = "!f() { git checkout --ours $@ && git add $@; }; f"
  • 44. PRO ALIASES & PROMPT rerere resolve! Reuse Recorded Resolution will help you when dealing with repetitive and similar merge conflicts. $ git config --global rerere.enabled true Turns it on and forget about it
  • 45. PRO ALIASES & PROMPT Sample output rerere $ git add hello.rb $ git commit Recorded resolution for 'hello.rb'. [master 68e16e5] Merge branch 'i18n'
  • 46. PRO ALIASES & PROMPT Sample output rerere $ git add hello.rb $ git commit Recorded resolution for 'hello.rb'. [master 68e16e5] Merge branch 'i18n' Auto-merging hello.rb CONFLICT (content): Merge conflict in hello.rb Resolved 'hello.rb' using previous resolution.
  • 47. Cover your tracks (aka polish your code)
  • 48. Cover your tracks (aka polish your code)
  • 49. POLISH YOUR CODE What is a rebase? It’s a way to replay commits, one by one, on top of a branch MASTER FEATURE
  • 50. POLISH YOUR CODE What is a rebase? It’s a way to replay commits, one by one, on top of a branch MASTER FEATURE
  • 51. POLISH YOUR CODE What is a rebase? It’s a way to replay commits, one by one, on top of a branch MASTER FEATURE
  • 52. POLISH YOUR CODE What is a rebase? It’s a way to replay commits, one by one, on top of a branch MASTER FEATURE
  • 53. POLISH YOUR CODE What is a rebase? It’s a way to replay commits, one by one, on top of a branch MASTER FEATURE Don’t use!
  • 54. POLISH YOUR CODE What is a rebase? Correct way to use rebase to update a feature branch MASTER FEATURE
  • 55. POLISH YOUR CODE What is a rebase? Correct way to use rebase to update a feature branch MASTER FEATURE
  • 56. POLISH YOUR CODE What is an --interactive rebase? It’s a way to replay commits, one by one, deciding interactively what to do with each PICK! SQUASH REWORD! FIXUP EDIT ! EXEC
  • 57. POLISH YOUR CODE --autosquash Automatically modify the todo list of rebase --interactive by annotating commits $ git config --global rebase.autosquash true Turns on the feature
  • 58. POLISH YOUR CODE --autosquash You can prepend commit messages with: git commit -m “squash! …" git commit -m “fixup! …" git commit -m “reword! …" etc… Rebase task list will be then prepopulated
  • 59. CUSTOMARY WARNING! rebase rewrites history! Treat this power with great care. Only rewrite history of local branches or…
  • 61. Always a balancing act Security DevSpeed
  • 62. PREVENT TAMPERING Lock down your repo Edit .git/config in the [receive] section: # no rewriting history denyNonFastForwards = true ! # no deleting history denyDeletes = true ! # check object consistency fsckObjects = true
  • 63. Reject force push, Luke Git project has already an update hook ‘update-paranoid’ that is designed to reject history rewriting updates http://bit.do/update-paranoid
  • 66. PREVENT TAMPERING Impersonating Authors is easy with $ git commit -m "I'm Luke" $ git commit --author "Elvis <elvis@graceland.net>" -m "I'm elvis" commit a9f0967cba236465d6cb68247.. Author: Elvis <elvis@graceland.net> Date: Mon Apr 22 18:06:35 2013 -0500 ! I'm Elvis ! commit d6eb7572cbb4bdd8e2aaa5c90.. Author: Luke <luke@tatooine.com> Date: Mon Apr 22 18:04:54 2013 -0500 ! I'm Luke
  • 67. PREVENT TAMPERING Finally you can sign/verify tags git tag -s <tag_name> -m “message” Sign a tag with your GPG key git tag -v <tag_name> Verifies that the signature is valid
  • 68. Signing release tags is often all you need
  • 69. PREVENT TAMPERING Aside on GPG The GNU Privacy Guard GnuPG allows to encrypt and sign your data and communication, features a versatile key management system.
  • 70. PREVENT TAMPERING Harden up by signing things Sample gpg commands to get you started:
  • 71. PREVENT TAMPERING Harden up by signing things Sample gpg commands to get you started: gpg --gen-key Generate your GPG keys
  • 72. PREVENT TAMPERING Harden up by signing things Sample gpg commands to get you started: gpg --gen-key Generate your GPG keys gpg -k List your keys
  • 73. PREVENT TAMPERING Harden up by signing things Sample gpg commands to get you started: gpg --gen-key Generate your GPG keys gpg -k List your keys gpg -a --export <keyid> Export your key
  • 74. PREVENT TAMPERING Hide files in raw objects The way the Linux kernel hackers do it git hash-object -w <file>
  • 75. PREVENT TAMPERING Hide files in raw objects The way the Linux kernel hackers do it actually writes into the object db git hash-object -w <file>
  • 76. PREVENT TAMPERING Hide files in raw objects The way the Linux kernel hackers do it actually writes into the object db git hash-object -w <file> Remember to associate a tag to it or it will be garbage collected
  • 77. PREVENT TAMPERING Store your signature in Simple! Add a tag referencing your public key gpg -a --export <keyid> | git hash-object -w --stdin Store your public key in a raw object
  • 78. PREVENT TAMPERING Store your signature in Simple! Add a tag referencing your public key gpg -a --export <keyid> | git hash-object -w --stdin Store your public key in a raw object git tag nicks-key 65704f3… Tag the raw object with a label
  • 79. PREVENT TAMPERING Store your signature in Simple! Add a tag referencing your public key gpg -a --export <keyid> | git hash-object -w --stdin Store your public key in a raw object git tag nicks-key 65704f3… Tag the raw object with a label raw object id
  • 80. PREVENT TAMPERING Import other public keys git cat-file -p tims-key | gpg --import Import a GPG key from a tag
  • 81. PREVENT TAMPERING Finally you can sign/verify tags git tag -s <tag_name> -m “message” Sign a tag with your GPG key git tag -v <tag_name> Verifies that the signature is valid
  • 83. How do you handle project dependencies with ?
  • 84. Splitting up a project is painful, for so many reasons
  • 85. Use a build/dependency tool instead of
  • 86. GIT AND PROJECT DEPENDENCIES I’ll give you an incomplete list of examples! Java Nodejs Javascript Python Pip easy-install Ruby
  • 87. GIT AND PROJECT DEPENDENCIES I’ll give you an incomplete list of examples! (2) C# C++ c-make Objective C PHP Go godep
  • 88. Another possibility: use git submodule
  • 90. Use other build and cross-stack dependency tools
  • 91. GIT AND PROJECT DEPENDENCIES For example you can check out: •Android Repo (http://bit.do/android-repo) •Repobuild (chrisvana / repobuild) •Chromium depot_tools (http://bit.do/depot-tools) •Facebook Buck (http://facebook.github.io/buck/) •Twitter Pants (http://bit.do/twitter-pants)
  • 92. PRO ALIASES & PROMPT Review these ideas online http://bit.do/git-deps
  • 93. Thank you! NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
  • 94. POWERS OF INVISIBILITY Hide files from • Level One • Level Two • Level Two • Level Two • Level One CODE FONT: <html xmlns="http://www.w3.org/1999/xhtml">
  • 95. POWERS OF INVISIBILITY Page title here • Level One • Level Two • Level Two • Level Two • Level One
  • 96. Page title here • Level One • Level Two • Level Two • Level Two • Level One
  • 97. Page title here Page Title Here • Level One • Level Two • Level Two • Level Two • Level One
  • 98. Page title here • Level One • Level Two • Level Two • Level Two • Level One
  • 101. Just text by itself, for impact.
  • 102. Just text by itself, for impact.
  • 103. Just text by itself, for impact.
  • 104. Just text by itself, for impact.
  • 105. Just text by itself, for impact.
  • 106. Type Quote Here And Move Both Quotation Marks To The Beginning And End Of The Quote. Lorem Ipsum Dolor Sit Amet, Conse Cetur Ading Elit. DAVID HANDLY, GLOBOCHEM ” “
  • 107. Big cool statistic 2,569 Add-Ons in Marketplace
  • 109. 60 45 30 15 0 2007 2008 2009 2010 Region 1 Region 2 Region 3 Page title here
  • 110. 40% 30% 20% 10% 2007 2008 2009 2010 Page title here
  • 111. Page title here COLUMN TITLE COLUMN TITLE COLUMN TITLE Content Content Content Content Content Content Content Content Content Content