Becoming a Git Master - Nicola Paolucci
description
Transcript of Becoming a Git Master - Nicola Paolucci
![Page 1: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/1.jpg)
#atlassian
![Page 2: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/2.jpg)
NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
Becoming a Git Master:Concepts and Techniques to convert you
into a master of the DVCS craft
![Page 3: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/3.jpg)
NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
Becoming a Git Master:Concepts and Techniques to convert you
into a master of the DVCS craft
![Page 4: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/4.jpg)
I'm George. George McFly. I'm your density… I mean,
your destiny
Stefan SaasenTim Pettersen
Marcus BertrandSarah Goff Dupont
![Page 5: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/5.jpg)
Let’s Become Git Pros!
![Page 6: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/6.jpg)
C O N F L I C T R E S O L U T I O N T I P S
H I D I N G S T U F F
Here you’ll learn:
P O L I S H Y O U R C O D E
P R E V E N T TA M P E R I N G
P R O J E C T D E P E N D E N C I E S
P R O A L I A S E S & P R O M P T
![Page 7: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/7.jpg)
A pro command prompt
![Page 8: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/8.jpg)
P R O A L I A S E S & P R O M P T
Everyone has their favorite, but!Liquid prompt is awesome
http://bit.do/liquid-prompt
![Page 9: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/9.jpg)
P R O A L I A S E S & P R O M P T
Everyone has their favorite, but!Liquid prompt is awesome
http://bit.do/liquid-prompt
![Page 10: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/10.jpg)
Crafting Awesome Aliases
![Page 11: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/11.jpg)
Aliases are stored in .gitconfig
![Page 12: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/12.jpg)
In a section prefixed: [alias]
![Page 13: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/13.jpg)
P R O A L I A S E S & P R O M P T
Basic Alias FormVery 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
![Page 14: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/14.jpg)
P R O A L I A S E S & P R O M P T
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
![Page 15: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/15.jpg)
You can’t pass parameters to simple aliases :(
![Page 16: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/16.jpg)
Or can you?!
![Page 17: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/17.jpg)
muahahhahahhahahahahahahahahhahahahhahahahah!
![Page 18: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/18.jpg)
P R O A L I A S E S & P R O M P T
For multiple commands or complex parameters use a bash function!You can escape to a shell with ! like this:
my_alias = "!f() { <command> }; f”
![Page 19: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/19.jpg)
P R O A L I A S E S & P R O M P T
Some useful shortcuts and variablesMore in any bash manual
$@ - all command line parameters passed
$1 - first command line parameter
$2 - second command line parameter
![Page 20: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/20.jpg)
Ma, it’s the mini-DSL I always wanted!
![Page 21: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/21.jpg)
P R O A L I A S E S & P R O M P T
What can you do with this?Cool cool things, for example add a Bitbucket remote:
git remote add $1 https://bitbucket.org/$2.git;
![Page 22: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/22.jpg)
P R O A L I A S E S & P R O M P T
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;
![Page 23: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/23.jpg)
P R O A L I A S E S & P R O M P T
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
![Page 24: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/24.jpg)
P R O A L I A S E S & P R O M P T
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
![Page 25: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/25.jpg)
P R O A L I A S E S & P R O M P T
Get all the alias goodness on Bitbuckethttp://bit.do/git-aliases
![Page 28: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/28.jpg)
Tell git which files or folders to ignore
in .gitignore
![Page 29: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/29.jpg)
What if the file is already committed?!
![Page 30: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/30.jpg)
muahahhahahhahahahahahahahahhahahahhahahahah!
![Page 31: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/31.jpg)
Hide files fromDifferent from .gitignore, it hides committed files
P O W E R S O F I N V I S I B I L I T Y
git update-index --assume-unchanged <file>
very useful with git-svn
![Page 32: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/32.jpg)
Hide files fromRevert it with:
P O W E R S O F I N V I S I B I L I T Y
git update-index --no-assume-unchanged <file>
remember to add --no
![Page 33: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/33.jpg)
P O W E R S O F I N V I S I B I L I T Y
List assumed unchanged files
git ls-files -v | grep ^h
Useful as alias (see alias list from before)
![Page 34: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/34.jpg)
Conflict Resolution Tips
![Page 35: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/35.jpg)
Conflict Resolution Tips
![Page 36: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/36.jpg)
What is a conflict?
![Page 37: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/37.jpg)
P R O A L I A S E S & P R O M P T
A word on terminology
Current checked out branch
!!!--ours
What do ours and theirs mean when solving conflicts?
![Page 38: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/38.jpg)
P R O A L I A S E S & P R O M P T
A word on terminology
Current checked out branch
!!!--ours
What do ours and theirs mean when solving conflicts?
Commit coming in (i.e. via merge)
!!!--theirs
![Page 39: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/39.jpg)
P R O A L I A S E S & P R O M P T
A word on terminology
Current checked out branch
!!!--ours
What do ours and theirs mean when solving conflicts?
Commit coming in (i.e. via merge)
!!!--theirs
![Page 40: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/40.jpg)
P R O A L I A S E S & P R O M P T
Basics for easy conflict resolutionThe common commands are:
$ git checkout --ours/--theirs <file> Check back out our own/their own version of the file
![Page 41: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/41.jpg)
P R O A L I A S E S & P R O M P T
Basics for easy conflict resolutionThe 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
![Page 42: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/42.jpg)
P R O A L I A S E S & P R O M P T
Aliases for easy conflict resolutionAdd these to [alias] in .gitconfig:
git checkout --ours $@ && git add $@;
![Page 43: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/43.jpg)
P R O A L I A S E S & P R O M P T
Aliases for easy conflict resolutionAdd these to [alias] in .gitconfig:
ours = "!f() { \ \ }; f" git checkout --ours $@ && git add $@;
![Page 44: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/44.jpg)
P R O A L I A S E S & P R O M P T
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
![Page 45: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/45.jpg)
P R O A L I A S E S & P R O M P T
Sample output rerere
$ git add hello.rb $ git commit Recorded resolution for 'hello.rb'. [master 68e16e5] Merge branch 'i18n'
![Page 46: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/46.jpg)
P R O A L I A S E S & P R O M P T
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.
![Page 47: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/47.jpg)
Cover your tracks(aka polish your code)
![Page 48: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/48.jpg)
Cover your tracks(aka polish your code)
![Page 49: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/49.jpg)
P O L I S H Y O U R C O D E
What is a rebase?It’s a way to replay commits, one by one,
on top of a branch
MASTER
FEATURE
![Page 50: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/50.jpg)
P O L I S H Y O U R C O D E
What is a rebase?It’s a way to replay commits, one by one,
on top of a branch
MASTER
FEATURE
![Page 51: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/51.jpg)
P O L I S H Y O U R C O D E
What is a rebase?It’s a way to replay commits, one by one,
on top of a branch
MASTER
FEATURE
![Page 52: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/52.jpg)
P O L I S H Y O U R C O D E
What is a rebase?It’s a way to replay commits, one by one,
on top of a branch
MASTER
FEATURE
![Page 53: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/53.jpg)
P O L I S H Y O U R C O D E
What is a rebase?It’s a way to replay commits, one by one,
on top of a branch
MASTER
FEATURE
Don’t use!
![Page 54: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/54.jpg)
P O L I S H Y O U R C O D E
What is a rebase?Correct way to use rebase to update a
feature branch
MASTER
FEATURE
![Page 55: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/55.jpg)
P O L I S H Y O U R C O D E
What is a rebase?Correct way to use rebase to update a
feature branch
MASTER
FEATURE
![Page 56: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/56.jpg)
P O L I S H Y O U R C O D E
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
![Page 57: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/57.jpg)
P O L I S H Y O U R C O D E
--autosquashAutomatically modify the todo list of
rebase --interactive by annotating commits
$ git config --global rebase.autosquash true Turns on the feature
![Page 58: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/58.jpg)
P O L I S H Y O U R C O D E
--autosquashYou 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
![Page 59: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/59.jpg)
CUSTOMARY WARNING!
rebase rewrites history!
Treat this power with great care. Only rewrite history of local branches or…
![Page 60: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/60.jpg)
Prevent tampering
![Page 61: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/61.jpg)
Always a balancing act
Security DevSpeed
![Page 62: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/62.jpg)
P R E V E N T TA M P E R I N G
Lock down your repo
# no rewriting history denyNonFastForwards = true !
# no deleting history denyDeletes = true !
# check object consistency fsckObjects = true
Edit .git/config in the [receive] section:
![Page 63: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/63.jpg)
Reject force push,Git project has already an update hook ‘update-paranoid’ that is designed to reject history rewriting updates
Luke
http://bit.do/update-paranoid
![Page 64: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/64.jpg)
Reject force push,Luke
![Page 65: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/65.jpg)
Reject force push,Luke
![Page 66: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/66.jpg)
P R E V E N T TA M P E R I N G
Impersonating Authors is easy with
$ git commit -m "I'm Luke" $ git commit --author "Elvis <[email protected]>" -m "I'm elvis" commit a9f0967cba236465d6cb68247.. Author: Elvis <[email protected]> Date: Mon Apr 22 18:06:35 2013 -0500 !
I'm Elvis !
commit d6eb7572cbb4bdd8e2aaa5c90.. Author: Luke <[email protected]> Date: Mon Apr 22 18:04:54 2013 -0500 !
I'm Luke
![Page 67: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/67.jpg)
P R E V E N T TA M P E R I N G
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
![Page 68: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/68.jpg)
Signing release tags is often all you need
![Page 69: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/69.jpg)
P R E V E N T TA M P E R I N G
Aside on GPGThe GNU Privacy Guard
GnuPG allows to encrypt and sign your data and communication, features a versatile key management system.
![Page 70: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/70.jpg)
P R E V E N T TA M P E R I N G
Harden up by signing things
Sample gpg commands to get you started:
![Page 71: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/71.jpg)
P R E V E N T TA M P E R I N G
Harden up by signing things
Sample gpg commands to get you started:
gpg --gen-keyGenerate your GPG keys
![Page 72: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/72.jpg)
P R E V E N T TA M P E R I N G
Harden up by signing things
Sample gpg commands to get you started:
gpg --gen-keyGenerate your GPG keys
gpg -kList your keys
![Page 73: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/73.jpg)
P R E V E N T TA M P E R I N G
Harden up by signing things
Sample gpg commands to get you started:
gpg --gen-keyGenerate your GPG keys
gpg -kList your keys
gpg -a --export <keyid>Export your key
![Page 74: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/74.jpg)
P R E V E N T TA M P E R I N G
The way the Linux kernel hackers do itHide files in raw objects
git hash-object -w <file>
![Page 75: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/75.jpg)
P R E V E N T TA M P E R I N G
The way the Linux kernel hackers do itHide files in raw objects
actually writes into the object db
git hash-object -w <file>
![Page 76: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/76.jpg)
P R E V E N T TA M P E R I N G
The way the Linux kernel hackers do itHide files in raw objects
actually writes into the object db
git hash-object -w <file>
Remember to associate a tag to it or it will be garbage collected
![Page 77: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/77.jpg)
P R E V E N T TA M P E R I N G
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
![Page 78: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/78.jpg)
P R E V E N T TA M P E R I N G
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
![Page 79: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/79.jpg)
P R E V E N T TA M P E R I N G
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
![Page 80: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/80.jpg)
P R E V E N T TA M P E R I N G
Import other public keys
git cat-file -p tims-key | gpg --import
Import a GPG key from a tag
![Page 81: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/81.jpg)
P R E V E N T TA M P E R I N G
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
![Page 82: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/82.jpg)
and Project Dependencies
![Page 83: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/83.jpg)
How do you handle project dependencies
with ?
![Page 84: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/84.jpg)
Splitting up a project is painful, for so many
reasons
![Page 85: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/85.jpg)
Use a build/dependency tool instead of
![Page 86: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/86.jpg)
G I T A N D P R O J E C T D E P E N D E N C I E S
I’ll give you an incomplete list of examples!
Java
Nodejs
Javascript
Python Pip easy-install
Ruby
![Page 87: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/87.jpg)
G I T A N D P R O J E C T D E P E N D E N C I E S
I’ll give you an incomplete list of examples! (2)
C#
C++ c-make
Objective C
PHP
Go godep
![Page 88: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/88.jpg)
Another possibility: use git submodule
![Page 89: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/89.jpg)
Another possibility: use git subtree
![Page 90: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/90.jpg)
Use other build and cross-stack
dependency tools
![Page 91: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/91.jpg)
G I T A N D P R O J E C T D E P E N D E N C I E S
•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)
For example you can check out:
![Page 92: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/92.jpg)
P R O A L I A S E S & P R O M P T
Review these ideas onlinehttp://bit.do/git-deps
![Page 93: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/93.jpg)
Thank you!
NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN
![Page 94: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/94.jpg)
P O W E R S O F I N V I S I B I L I T Y
Hide files from • Level One• Level Two• Level Two• Level Two
• Level One
CODE FONT: <html xmlns="http://www.w3.org/1999/xhtml">
![Page 95: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/95.jpg)
P O W E R S O F I N V I S I B I L I T Y
Page title here• Level One• Level Two• Level Two• Level Two
• Level One
![Page 96: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/96.jpg)
Page title here
• Level One• Level Two• Level Two• Level Two
• Level One
![Page 97: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/97.jpg)
Page title here
• Level One• Level Two• Level Two• Level Two
• Level One
Page Title Here
![Page 98: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/98.jpg)
• Level One• Level Two• Level Two• Level Two
• Level One
Page title here
![Page 99: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/99.jpg)
![Page 100: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/100.jpg)
Caption goes here
![Page 101: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/101.jpg)
Just text by itself, for impact.
![Page 102: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/102.jpg)
Just text by itself, for impact.
![Page 103: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/103.jpg)
Just text by itself, for impact.
![Page 104: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/104.jpg)
Just text by itself, for impact.
![Page 105: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/105.jpg)
Just text by itself, for impact.
![Page 106: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/106.jpg)
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. D AV I D H A N D LY, G L O B O C H E M
”
“
![Page 107: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/107.jpg)
Big cool statistic
2,569Add-Ons in Marketplace
![Page 108: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/108.jpg)
![Page 109: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/109.jpg)
0
15
30
45
60
2007 2008 2009 2010
Region 1 Region 2 Region 3
Page title here
![Page 110: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/110.jpg)
40%
30%
20%
10%
2007 2008 2009 2010
Page title here
![Page 111: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/111.jpg)
Content Content
Content Content
Content Content
Content Content
Content Content
Page title here
C O L U M N T I T L E C O L U M N T I T L E C O L U M N T I T L E
![Page 112: Becoming a Git Master - Nicola Paolucci](https://reader038.fdocuments.in/reader038/viewer/2022102721/54b962244a795991218b4656/html5/thumbnails/112.jpg)