On Github agross / git-reveal
$ /dont-panic/
$ git <verb>
$ git help <verb> $ git <verb> --help
$ git init Initialized empty Git repository in /scratch/.git/ $ echo hello, world > hello.txt $ git add hello.txt $ git commit -m "my first commit!" [master (root-commit) ad9a291] my first commit! 1 file changed, 1 insertion(+) create mode 100644 hello.txt
$ git log --patch commit ad9a291416165bb95a541321a7acf9cef9731c1d Author: Alexander Groß <agross@therightstuff.de> Date: Sat Feb 6 12:41:24 2010 +0100 my first commit! diff --git a/hello.txt b/hello.txt new file mode 100644 index 0000000..4b5fa63 --- /dev/null +++ b/hello.txt @@ -0,0 +1 @@ +hello, world
$ git branch testing <where>(<where> defaults to HEAD)
$ git checkout testing
$ git checkout -b <name> <where> == $ git branch <name> <where> && git checkout <name>
$ git commit -am "work on testing"
$ git checkout master
$ git commit -am "work on master"
Your options:
Visualizing a "Git Merge" pic.twitter.com/RQJ2AV7JRQ
— David Rousset (@davrous) August 20, 2016$ git checkout master $ git merge experimentThis is a recursive merge, as it integrates two diverged branches.
$ git reset --hard C3
$ git checkout master $ git merge experimentThis is a fast-forward merge as the master pointer can be moved from C3 to C4 without losing commits reachable from master.
$ git merge --ff-only
Enforces a fast-forward merge, aborts if history is diverged.
$ git merge --no-ff
Enforces a recursive merge, even if a fast-forward merge would be possible.
$ git merge --strategy-option ours
Prefer our changes when encountering conflicts.
$ git merge -X theirs
Prefer their changes when encountering conflicts.
$ git checkout experiment $ git rebase masterCommit C4 is applied on top of master as C4'.
$ git rebase origin/master pic.twitter.com/pAHtrPrm84
— Alejandro AR (@kinduff) January 16, 2015This is from a project I am working on. #git #rebase vs. #merge pic.twitter.com/TRgsq7BSin
— MiCHΛΞl (@michaelhenke) April 6, 2015$ git rebase --onto master server client
Again, you have two options: