CreatingTo create a local repository cd ~/projects/myproject git init git add . To clone from a remote repository (possible ways to do it) git clone /existing/repo /new/repo git clone git://host.org/project.git git clone ssh://you@host.org/proj.git Local
Main difference between git merge and git rebase is that rebase makes commits to be in a one line under each other on a tree, which leads to loosing the order of changes. Merge creates a new commit which keeps the order of changes in the project. It's just the matter of tree simplicity and keeping changes between them. |
Remote
Fetch, pull and push have a specific syntax if we want to specify the source and destination commits. Basically we can use two forms: git fetch/pull/push destination source for whole commit tree branch git fetch/pull/push origin source:destination for specific commits |
Cheatography
https://cheatography.com
Git cheat sheet Cheat Sheet (DRAFT) by Ripp
My personal cheat sheet for git
This is a draft cheat sheet. It is a work in progress and is not finished yet.