* from Geek Hero Comic CC-By-NC-SA 3.0
Linus Torvalds, Linux Kernel Creator
I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'git'.
A SCM that is
a content manager
stored as an objects acyclic graph
objects accessible through references
There were only plumbing commmands
Many frontends were made available (cogito, eg)
Understanding git internals is the key for efficient use
Remember that git is a content manager
Is a
Built upon two data structures
Every object is identified by a SHA-1
Which garantees unicity up to 2^160 objects
Also know as staging area
They're just references too, that's why you get cheap branching !
tags !
No more assymetry between maintainer(s) and the others
37 main
14 manipulations
16 interrogations
9 interactions
init/merge/clone
fetch/commit/push/branch
checkout/add/log/diff
git config --global user.name "John Doe"
git config --global user.email john@doe.com
Tell git to ignore files:
globally:
!bash git config --global core.excludesfile ~/.gitignore
# Compiled source
*.o
*.so
# python
__pycache__
*.py[cdo]
# editors stuff
*~
.\#*
git config --global alias.st "status -sb"
st = status -sb
ci = commit
co = checkout
br = branch -a
rb = rebase
sb = show-branch
unadd = rm -r --cached
wd = diff --word-diff
ws = show --word-diff
purr = pull --rebase
amend = commit --amend
ref^ = ref parent
ref~2 = ref grand-parent
git help -w gittutorial
git init <green-field-project>
git clone --bare <green-field-project>> # gives you <green-field-project.git>
git clone <uri-repository>
git remote add backup <uri>
git remote set-url backup <new-uri>
git fetch
git pull # git fetch; git merge
git pull --rebase # git fetch; git rebase
git push
git branch foo
git branch -m
git branch -D bar
git push origin foo
git push --set-upstream origin foo:baz
git push origin :origin/foo
git checkout myfeature # origin/myfeature exists
git checkout -b myfeature-local --track origin/myfeature
$ git branch
* default
experiment
$ git branch
default
* experiment
git add -p
git stash
git commit --amend
git reflog
... and make it simpler with rebasing !
git rebase master
... let's rewrite history
git cherry-pick C9
allows you to:
Social Coding Platform
https://github.com/blog/1124-how-we-use-pull-requests-to-build-github
Table of Contents | t |
---|---|
Exposé | ESC |
Full screen slides | e |
Presenter View | p |
Source Files | s |
Slide Numbers | n |
Toggle screen blanking | b |
Show/hide slide context | c |
Notes | 2 |
Help | h |