Skip to content

Instantly share code, notes, and snippets.

@mvvitorsilvati
Forked from giggio/_latest.md
Created September 26, 2020 20:26
Show Gist options
  • Save mvvitorsilvati/77e7a587370e5a3131f7253171b78790 to your computer and use it in GitHub Desktop.
Save mvvitorsilvati/77e7a587370e5a3131f7253171b78790 to your computer and use it in GitHub Desktop.
My .gitconfig and .gitattributes
[user]
name = Giovanni Bassi
email = giggio@email
[diff]
indentHeuristic = true
submodule = log
[color]
diff = always
interactive = always
status = always
branch = always
[alias]
st = status
ci = commit
co = checkout
br = branch
fixup = commit --all --amend --no-edit
open = !explorer `git config remote.origin.url`
browse = !git open
up = push upstream master
sync = pull upstream master --rebase
which = !git branch | grep -i
daily = !sh -c 'git log --since=yesterday --format=%s --author=Giovanni'
serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
graph = log --graph
ngrok = "!f() { \
NGROK_WAIT=${NGROK_WAIT:-1}; \
git serve & ngrok tcp 9418 > /dev/null 2>&1 & \
echo >&2 "Waiting $NGROK_WAIT seconds for git daemon and ngrok to start..."; \
sleep $NGROK_WAIT; \
public_url=$(curl -s http://localhost:4040/api/tunnels/command_line | jq -r '.public_url[3:]'); \
public_url="git$public_url/"; \
echo "Serving repo at: $public_url"; \
echo "Press CTRL C to stop."; \
sleep infinity; \
}; f"
pr = "!f() { exec vsts code pr \"$@\"; }; f"
repo = "!f() { exec vsts code repo \"$@\"; }; f"
vpr = "!f() { exec vsts code pr \"$@\"; }; f"
repo = "!f() { exec vsts code repo \"$@\"; }; f"
squash = "!f() { git reset --hard $1; git merge --squash HEAD@{1}; git commit; }; f"
[pull]
ff = only
[push]
default = simple
[log]
decorate = full
abbrevCommit = true
[format]
pretty=format:%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset
[gui]
gcwarning = false
[commit]
gpgsign = true
[gpg]
program = C:/Program Files (x86)/GNU/GnuPG/pub/gpg.EXE
[core]
#pager = diff-so-fancy | less --tabs=4 -RFX
pager = delta --dark
longpaths = true
[diff "pandoc2md"]
textconv = pandoc --to=markdown
[diff "wrap"]
textconv = fmt
[diff "xlsx"]
textconv = python -m xlsx2csv
[diff "listzipfiles"]
textconv = unzip -l
[merge "npm-merge-driver"]
name = automatically merge npm lockfiles
driver = npx npm-merge-driver merge %A %O %B %P
[credential]
helper = manager
npm-shrinkwrap.json merge=npm-merge-driver
package-lock.json merge=npm-merge-driver
*.docx diff=pandoc2md
*.md diff=wrap
*.xlsx diff=xlsx
*.zip diff=listzipfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment