-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit.cheat
31 lines (22 loc) · 853 Bytes
/
git.cheat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% git
# Create personal config
cd ~
git config --file=.gitconfig_personal.gitconfig --add user.name "mthornba"
git config --file=.gitconfig_personal.gitconfig --add user.email matt.thornback@gmail.com
git config --file=.gitconfig_personal.gitconfig --add core.sshCommand 'ssh -i /Users/matt/.ssh/id_rsa.mthornba_github -F /dev/null'
git config --global --add includeif.gitdir:~/Code/personal/.path .gitconfig_personal.gitconfig
# Get current commit hash
git rev-parse --short HEAD
# git diff, highlight characters
git diff --color-words=.
# git diff, highlight words
git diff --color-words=
# Find commit where file was added
git log --diff-filter=A -- <filename>
# Find commits where diff contains <string>
git log -S'<string>' -- <filename>
% gh
# Login to github.com
gh auth login -p https -h github.com
# Check login status
gh auth status