git add -i
Stage changes interactively
git add --patch/-p
Stage files partially. This command allows choosing hunks of file to stage
git add -i
git add --patch/-p
git branch
git branch -a
git branch -v
git branch -vv
git branch -u $upstream $localbranch
git checkout --conflict=diff3 filepath
$$ git checkout --conflict=diff3 testfile.txt
$$ cat testfile.txt
Hello World
<<<<<<< ours
ABCAAAAAAAAAAAAAAAAA
||||||| base
ABCAA
=======
ABCAADGHLAAAAA
>>>>>>> theirs
git checkout --patch/-p filepath
git clean -n
git clean
git clean -d -f
git clean -d -f -x
git clean -i
git commit
git commit -m 'my commit message'
git commit -a -m 'my commit message'
git commit -a -S -m 'my commit message'
git commit -amend
git config --system <property> <value>
git config --global <property> <value>
git config <property> <value>
git config user.signingkey 0A46826A
git clean -i
git grep -n div
$$ git grep -n div
git.min.js:461: var divisor = encoding.length;
git.min.js:465: /* Convert to an array of 16-bit big-endian values, forming the dividend */
git.min.js:466: var dividend = Array(Math.ceil(input.length / 2));
git.min.js:467: for(i = 0; i < dividend.length; i++)
git.min.js:469: dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
git.min.js:473: * Repea
git grep --count div
$$ git grep --count div
git_notes/gitNotesBackup.html:128
git_notes/git_Add.html:11
git_notes/git_Branch.html:24
git_notes/git_Checkout.html:11
git_notes/git_Clean.html:24
git_notes/git_Commit.html:20
git_notes/git_Config.html:24
git_notes/git_Hooks.html:68
git_notes/git_Log.html:34
git_notes/git_Merge.html:16
git_notes/git_Reflog.html:7
git_notes/git_RevParse.html:7
git grep -p/--show-function {term} [files]
git grep {term/pattern} {tag/ref/SHA} {files}
git grep --break {term/pattern} {tag/ref/SHA} {files}
git grep --heading {term/pattern} {tag/ref/SHA} {files}
git grep git grep -p -e {pattern1} div --and -e {pattern2} {tag/ref/SHA} {files}
pre-commit
prepare-commit-msg
commit-msg
post-commit
applypatch-msg
pre-applypatch
post-applypatch
pre-rebase
post-rewrite
post-checkout
post-merge
pre-push
pre-auto-gc
pre-recieve
update
post-recieve
git log
commit af7725caab2d197f07c72f6d9a4814d5d9ce9e53
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:01:30 2016 +0530
Commit D
commit 662b3caf91bbb8faf56ef7262615a8828b381be1
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:01:16 2016 +0530
Commit C
commit f46d0d9949274bba7f797a5b63bc004f291905b4
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:01:03 2016 +0530
Commit B
commit bbb738746b14e8e4ac09a443e9ac1c931ad61d07
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:00:29 2016 +0530
Commit A
git log --abbrev-commit
commit af7725c
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:01:30 2016 +0530
Commit D
commit 662b3ca
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:01:16 2016 +0530
Commit C
commit f46d0d9
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:01:03 2016 +0530
Commit B
commit bbb7387
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:00:29 2016 +0530
Commit A
git log --oneline
af7725c Commit D
662b3ca Commit C
f46d0d9 Commit B
bbb7387 Commit A
git log -g
commit af7725caab2d197f07c72f6d9a4814d5d9ce9e53
Reflog: HEAD@{0} (Nitin Nizhawan )
Reflog message: checkout: moving from testBranch to master
Author: Nitin Nizhawan
Date: Sat Feb 27 21:01:30 2016 +0530
Commit D
commit 662b3caf91bbb8faf56ef7262615a8828b381be1
Reflog: HEAD@{1} (Nitin Nizhawan )
Reflog message: checkout: moving from master to testBranch
Author: Nitin Nizhawan
Date: Sat Feb 27 21:01:16 2016 +0530
Commit C
commit af7725caab2d197f07c72f6d9a4814d5d9ce9e53
Reflog: HEAD@{2} (Nitin Nizhawan )
Reflog message: reset: moving to af7725c
Author: Nitin Nizhawan
Date: Sat Feb 27 21:01:30 2016 +0530
Commit D
commit 662b3caf91bbb8faf56ef7262615a8828b381be1
Reflog: HEAD@{3} (Nitin Nizhawan )
Reflog message: reset: moving to HEAD^
Author: Nitin Nizhawan
Date: Sat Feb 27 21:01:16 2016 +0530
Commit C
commit af7725caab2d197f07c72f6d9a4814d5d9ce9e53
Reflog: HEAD@{4} (Nitin Nizhawan )
Reflog message: commit: Commit D
Author: Nitin Nizhawan
Date: Sat Feb 27 21:01:30 2016 +0530
Commit D
git log -g master
commit 20e9855e2b90ee6580c3b8db250dae0d9b18cff1
Reflog: master@{0} (Nitin Nizhawan <abc@example.com>)
Reflog message: commit: Commit E
Author: Nitin Nizhawan
Date: Sun Feb 28 11:54:30 2016 +0530
Commit E
commit af7725caab2d197f07c72f6d9a4814d5d9ce9e53
Reflog: master@{1} (Nitin Nizhawan <abc@example.com>)
Reflog message: reset: moving to af7725c
Author: Nitin Nizhawan
Date: Sat Feb 27 21:01:30 2016 +0530
Commit D
commit 662b3caf91bbb8faf56ef7262615a8828b381be1
Reflog: master@{2} (Nitin Nizhawan <abc@example.com>)
Reflog message: reset: moving to HEAD^
Author: Nitin Nizhawan
Date: Sat Feb 27 21:01:16 2016 +0530
Commit C
commit af7725caab2d197f07c72f6d9a4814d5d9ce9e53
Reflog: master@{3} (Nitin Nizhawan <abc@example.com>)
Reflog message: commit: Commit D
Author: Nitin Nizhawan
Date: Sat Feb 27 21:01:30 2016 +0530
Commit D
git log refA..refB
$$ git log --graph --pretty=oneline --abbrev-commit --all
* 20e9855 Commit E
* af7725c Commit D
| * cb2e193 TestBranchB
| * ac4148c Commit TestBranchA
|/
* 662b3ca Commit C
* f46d0d9 Commit B
* bbb7387 Commit A
$$ git log --oneline master..testBranch
cb2e193 TestBranchB
ac4148c Commit TestBranchA
$$ git log --oneline testBranch..master
20e9855 Commit E
af7725c Commit D
git log refB --not refA
$$ git log --graph --pretty=oneline --abbrev-commit --all
* 20e9855 Commit E
* af7725c Commit D
| * cb2e193 TestBranchB
| * ac4148c Commit TestBranchA
|/
* 662b3ca Commit C
* f46d0d9 Commit B
* bbb7387 Commit A
$$ git log --oneline testBranch --not master
cb2e193 TestBranchB
ac4148c Commit TestBranchA
$$ git log --oneline master --not testBranch
20e9855 Commit E
af7725c Commit D
git log ^refA refB
$$ git log --graph --pretty=oneline --abbrev-commit --all
* 20e9855 Commit E
* af7725c Commit D
| * cb2e193 TestBranchB
| * ac4148c Commit TestBranchA
|/
* 662b3ca Commit C
* f46d0d9 Commit B
* bbb7387 Commit A
$$ git log --oneline ^master testBranch
cb2e193 TestBranchB
ac4148c Commit TestBranchA
$$ git log --oneline ^testBranch master
20e9855 Commit E
af7725c Commit D
git log refA...refB
$$ git log --graph --pretty=oneline --abbrev-commit --all
* 20e9855 Commit E
* af7725c Commit D
| * cb2e193 TestBranchB
| * ac4148c Commit TestBranchA
|/
* 662b3ca Commit C
* f46d0d9 Commit B
* bbb7387 Commit A
$$ git log --oneline master...testBranch
20e9855 Commit E
cb2e193 TestBranchB
ac4148c Commit TestBranchA
af7725c Commit D
$$ git log --oneline master...testBranch --left-right
< 20e9855 Commit E
> cb2e193 TestBranchB
> ac4148c Commit TestBranchA
< af7725c Commit D
git log --show-signature
git log -Sterm
git log -L {start_line_no},{end_line_no}:{filepath}
git log -L /{start_regex}/,/{end_regex}/:{filepath}
git merge abc
git merge --verify-signatures abc
git merge --verify-signatures -S abc
git reflog
af7725c HEAD@{0}: checkout: moving from testBranch to master
662b3ca HEAD@{1}: checkout: moving from master to testBranch
af7725c HEAD@{2}: reset: moving to af7725c
662b3ca HEAD@{3}: reset: moving to HEAD^
af7725c HEAD@{4}: commit: Commit D
662b3ca HEAD@{5}: commit: Commit C
f46d0d9 HEAD@{6}: commit: Commit B
bbb7387 HEAD@{7}: commit (initial): Commit A
git rev-parse master
af7725caab2d197f07c72f6d9a4814d5d9ce9e53
git show bbb738746b14e8e4ac09a443e9ac1c931ad61d07
commit bbb738746b14e8e4ac09a443e9ac1c931ad61d07
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:00:29 2016 +0530
Commit A
diff --git a/testfile.txt b/testfile.txt
new file mode 100644
index 0000000..557db03
--- /dev/null
+++ b/testfile.txt
@@ -0,0 +1 @@
+Hello World
git show bbb738
commit bbb738746b14e8e4ac09a443e9ac1c931ad61d07
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:00:29 2016 +0530
Commit A
diff --git a/testfile.txt b/testfile.txt
new file mode 100644
index 0000000..557db03
--- /dev/null
+++ b/testfile.txt
@@ -0,0 +1 @@
+Hello World
git show master
commit bbb738746b14e8e4ac09a443e9ac1c931ad61d07
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:00:29 2016 +0530
Commit A
diff --git a/testfile.txt b/testfile.txt
new file mode 100644
index 0000000..557db03
--- /dev/null
+++ b/testfile.txt
@@ -0,0 +1 @@
+Hello World
git show HEAD@{7}
commit bbb738746b14e8e4ac09a443e9ac1c931ad61d07
Author: Nitin Nizhawan <abc@example.com>
Date: Sat Feb 27 21:00:29 2016 +0530
Commit A
diff --git a/testfile.txt b/testfile.txt
new file mode 100644
index 0000000..557db03
--- /dev/null
+++ b/testfile.txt
@@ -0,0 +1 @@
+Hello World
git show master@{3.hour.41.minute.ago}
commit f46d0d9949274bba7f797a5b63bc004f291905b4 Author: Nitin NizhawanDate: Sat Feb 27 21:01:03 2016 +0530 Commit B diff --git a/testfile.txt b/testfile.txt index 557db03..bc1c618 100644 --- a/testfile.txt +++ b/testfile.txt @@ -1 +1,2 @@ Hello World +ABC
git show --oneline HEAD^2~1
$$ git log --graph --pretty=oneline --abbrev-commit
* 72cdd46 Merge branch 'testBranch'
|\
| * cb2e193 TestBranchB
| * ac4148c Commit TestBranchA
* | 20e9855 Commit E
* | af7725c Commit D
|/
* 662b3ca Commit C
* f46d0d9 Commit B
* bbb7387 Commit A
$$ git show --oneline HEAD^2~1
ac4148c Commit TestBranchA
diff --git a/testfile.txt b/testfile.txt
index 0685a0a..965369c 100644
--- a/testfile.txt
+++ b/testfile.txt
@@ -1,2 +1,2 @@
Hello World
-ABCAA
+ABCAADGHL
$$ git show --oneline HEAD^1~1
af7725c Commit D
diff --git a/testfile.txt b/testfile.txt
index 0685a0a..6a31125 100644
--- a/testfile.txt
+++ b/testfile.txt
@@ -1,2 +1,2 @@
Hello World
-ABCAA
+ABCAAAAAAA
git stash --patch/-p
git stash --keep-index
git stash apply --index
git stash --include-untracked/-u
git stash branch <branchname>
git stash --all
git tag v1.2
git tag -a v1.2
git tag -s v1.2
git tag -v v1.2
git tag