Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Git Cheat Sheet the curves indicate that the command on the right is usually
executed after the command on the left. This gives an idea of
http://git.or.cz/ the flow of commands someone usually does with Git.
Useful Commands
git bisect good $id ($id is the last working version) git diff --base $file (against base file)
A specific file from a specific $ID git checkout $branch2 git bisect bad $id ($id is a broken version) git diff --ours $file (against your changes)
git show $id:$file git merge branch1 git diff --theirs $file (against other changes)
git bisect bad/good (to mark it as bad or good)
Create branch named $branch based on git bisect visualize (to launch gitk and mark it)
All local branches
the HEAD git bisect reset (once you're done)
To discard conflicting patch
git branch git branch $branch
(star '*' marks the current branch) git reset --hard
Create branch $new_branch based on Check for errors and cleanup repository git rebase --skip
branch $other and switch to it git fsck
Cheat Sheet Notation git checkout -b $new_branch $other git gc --prune
After resolving conflicts, merge with
$id : notation used in this sheet to represent either a Search working directory for foo()
commit id, branch or a tag name
Delete branch $branch git add $conflicting_file (do for all resolved files)
git branch -d $branch git grep "foo()" git rebase --continue
$file : arbitrary file name
$branch : arbitrary branch name Zack Rusin
Based on the work of:
Sébastien Pierre
Xprima Corp.