From 30626c3ea9f891849a1883947f7417b58992a140 Mon Sep 17 00:00:00 2001 From: Morgan Date: Fri, 9 Aug 2019 04:54:41 +0200 Subject: [PATCH] cheat for git --- cheat/git.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cheat/git.md diff --git a/cheat/git.md b/cheat/git.md new file mode 100644 index 0000000..bc42066 --- /dev/null +++ b/cheat/git.md @@ -0,0 +1,12 @@ +### Undo last commit while keeping changes + +`git reset HEAD^` + +### Most active hours from git history ([src](https://gist.github.com/bessarabov/674ea13c77fc8128f24b5e3f53b7f094#gistcomment-2973934)) + +``` +git log --author="Morgan" \ + --format="%ad" \ + --date="format:%H" |\ + awk '{n=$1+0;if(H[n]++>max)max=H[n]}END{for(i=0;i<24;i++){printf"%02d -%5d ",i,H[i];for(n=0;n