Last active
July 7, 2017 23:03
-
-
Save 333fred/d3892f9ca21afa8ea518a161ddad764c to your computer and use it in GitHub Desktop.
My .gitconfig with shortcuts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: my aliases assume all commits will be signed with a gpg key. To not sign with a gpg key, remove the -S from the commit aliases | |
# If signing with a gpg key, make sure to set the gpg with git config --global user.signingkey KEY_ID_HERE | |
[user] | |
name = Fredric Silberberg | |
email = | |
signingkey = | |
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold | |
old = red | |
new = green | |
[alias] | |
# add | |
a = add # add | |
svnl = svn log --oneline --show-commit | |
au = add -u # add tracked | |
aa = add . # add current directory | |
ap = add -p # stage commits chunk by chunk | |
chunkyadd = add --patch # stage commits chunk by chunk | |
# via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/ | |
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}" | |
snapshots = !git stash list --grep snapshot | |
#via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit | |
recent-branches = !git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short)' | |
# branch | |
b = branch -v # branch (verbose) | |
bd = branch -d # branch (delete) | |
bD = branch -D # branch (force delete) | |
# commit | |
c = commit # commit | |
cm = commit -m # commit with message | |
ca = commit -a # commit all | |
cam = commit -am # commit all | |
caa = commit -a --amend # add all tracked and amend your last commit | |
amend = commit --amend # amend your last commit | |
am = commit --amend # amend your last commit (sign) | |
ammend = commit --amend # amend your last commit | |
# checkout | |
co = checkout # checkout | |
cob = checkout -b # create and switch to a new branch | |
nb = checkout -b # create and switch to a new branch (mnemonic: "git new branch branchname...") | |
# clone | |
cl = clone | |
clr = clone --recursive | |
# cherry-pick | |
cp = cherry-pick -x # grab a change from a branch | |
# diff | |
d = diff # diff unstaged changes | |
dc = diff --cached # diff staged changes | |
last = diff HEAD^ # diff last committed change | |
dl = "!git ll -1" | |
filelog = log -u | |
fl = log -u | |
dlc = diff --cached HEAD^ | |
# fetch | |
f = fetch | |
fd = fetch dotnet | |
# log | |
l = log --graph --date=short | |
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn,\\ %cr]" --decorate | |
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn,\\ %cr]" --decorate --numstat | |
# merge | |
m = merge | |
mm = merge master | |
mmf = merge master --ff-only | |
mf = merge --ff-only | |
md = merge dotnet/master | |
mdf = merge --ff-only dotnet/master | |
# pull | |
pl = pull # pull | |
# push | |
ps = push # push | |
psf = push -f # push force | |
psu = push --set-upstream # push with setting upstream | |
psuo = push --set-upstream origin # push with setting upstream to be a branch in the origin remote | |
# rebase | |
rb = rebase # rebase | |
rbi = rebase -i # interactive rebase | |
rc = rebase --continue # continue rebase | |
rs = rebase --skip # skip rebase | |
rbb = "!git rebase -i `git merge-base master HEAD`" # rebase the current branch | |
# remote | |
r = remote -v # show remotes (verbose) | |
ra = remote add | |
rsu = remote set-url | |
# reset | |
unstage = reset HEAD # remove files from index (tracking) | |
uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state | |
filelog = log -u # show changes to a file | |
mt = mergetool # fire up the merge tool | |
nuke = reset --hard HEAD # nuke from orbit | |
scorch = !git nuke && git clean -xfd | |
# stash | |
ss = stash # stash changes | |
sp = stash pop # pop the stash | |
sl = stash list # list stashes | |
sa = stash apply # apply stash (restore changes) | |
sd = stash drop # drop stashes (destory changes) | |
# status | |
s = status # status | |
st = status # status | |
stat = status # status | |
# tag | |
t = tag -n # show tags with <n> lines of each tag message | |
# index | |
chmod = update-index --chmod # Update the perms of a file | |
cx = chmod +x # Set a file to executable | |
assume = update-index --assume-unchanged # Always assume file is unchanged | |
unassume = update-index --no-assume-unchanged # Undo above command | |
[format] | |
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset | |
[merge] | |
summary = true | |
verbosity = 1 | |
[apply] | |
whitespace = nowarn | |
[branch] | |
autosetupmerge = true | |
[push] | |
# 'git push' will push the current branch to its tracking branch | |
# the usual default is to push all branches | |
default = upstream | |
[core] | |
autocrlf = true | |
fscache = true | |
preloadindex = true | |
safecrlf = true | |
editor = vim | |
[advice] | |
statusHints = false | |
[diff] | |
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject | |
# instead of a/b/c/d as prefixes for patches | |
mnemonicprefix = true | |
algorithm = patience | |
[rerere] | |
# Remember my merges | |
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/ | |
enabled = true | |
[include] | |
path = .gitconfig.user | |
[commit] | |
gpgsign = true | |
[gpg] | |
program = c:/Program Files (x86)/GNU/GnuPG/gpg2.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by https://www.gitignore.io/api/visualstudiocode,visualstudio,vim | |
### VisualStudioCode ### | |
.vscode/* | |
!.vscode/settings.json | |
!.vscode/tasks.json | |
!.vscode/launch.json | |
### Vim ### | |
# swap | |
[._]*.s[a-w][a-z] | |
[._]s[a-w][a-z] | |
# session | |
Session.vim | |
# temporary | |
.netrwhist | |
*~ | |
# auto-generated tag files | |
tags | |
### VisualStudio ### | |
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# User-specific files | |
*.suo | |
*.user | |
*.userosscache | |
*.sln.docstates | |
# User-specific files (MonoDevelop/Xamarin Studio) | |
*.userprefs | |
# Build results | |
[Dd]ebug/ | |
[Dd]ebugPublic/ | |
[Rr]elease/ | |
[Rr]eleases/ | |
x64/ | |
x86/ | |
bld/ | |
[Bb]in/ | |
[Oo]bj/ | |
[Ll]og/ | |
# Visual Studio 2015 cache/options directory | |
.vs/ | |
# Uncomment if you have tasks that create the project's static files in wwwroot | |
#wwwroot/ | |
# MSTest test Results | |
[Tt]est[Rr]esult*/ | |
[Bb]uild[Ll]og.* | |
# NUNIT | |
*.VisualState.xml | |
TestResult.xml | |
# Build Results of an ATL Project | |
[Dd]ebugPS/ | |
[Rr]eleasePS/ | |
dlldata.c | |
# DNX | |
project.lock.json | |
project.fragment.lock.json | |
artifacts/ | |
*_i.c | |
*_p.c | |
*_i.h | |
*.ilk | |
*.meta | |
*.obj | |
*.pch | |
*.pdb | |
*.pgc | |
*.pgd | |
*.rsp | |
*.sbr | |
*.tlb | |
*.tli | |
*.tlh | |
*.tmp | |
*.tmp_proj | |
*.log | |
*.vspscc | |
*.vssscc | |
.builds | |
*.pidb | |
*.svclog | |
*.scc | |
# Chutzpah Test files | |
_Chutzpah* | |
# Visual C++ cache files | |
ipch/ | |
*.aps | |
*.ncb | |
*.opendb | |
*.opensdf | |
*.sdf | |
*.cachefile | |
*.VC.db | |
*.VC.VC.opendb | |
# Visual Studio profiler | |
*.psess | |
*.vsp | |
*.vspx | |
*.sap | |
# TFS 2012 Local Workspace | |
$tf/ | |
# Guidance Automation Toolkit | |
*.gpState | |
# ReSharper is a .NET coding add-in | |
_ReSharper*/ | |
*.[Rr]e[Ss]harper | |
*.DotSettings.user | |
# JustCode is a .NET coding add-in | |
.JustCode | |
# TeamCity is a build add-in | |
_TeamCity* | |
# DotCover is a Code Coverage Tool | |
*.dotCover | |
# NCrunch | |
_NCrunch_* | |
.*crunch*.local.xml | |
nCrunchTemp_* | |
# MightyMoose | |
*.mm.* | |
AutoTest.Net/ | |
# Web workbench (sass) | |
.sass-cache/ | |
# Installshield output folder | |
[Ee]xpress/ | |
# DocProject is a documentation generator add-in | |
DocProject/buildhelp/ | |
DocProject/Help/*.HxT | |
DocProject/Help/*.HxC | |
DocProject/Help/*.hhc | |
DocProject/Help/*.hhk | |
DocProject/Help/*.hhp | |
DocProject/Help/Html2 | |
DocProject/Help/html | |
# Click-Once directory | |
publish/ | |
# Publish Web Output | |
*.[Pp]ublish.xml | |
*.azurePubxml | |
# TODO: Comment the next line if you want to checkin your web deploy settings | |
# but database connection strings (with potential passwords) will be unencrypted | |
*.pubxml | |
*.publishproj | |
# Microsoft Azure Web App publish settings. Comment the next line if you want to | |
# checkin your Azure Web App publish settings, but sensitive information contained | |
# in these scripts will be unencrypted | |
PublishScripts/ | |
# NuGet Packages | |
*.nupkg | |
# The packages folder can be ignored because of Package Restore | |
**/packages/* | |
# except build/, which is used as an MSBuild target. | |
!**/packages/build/ | |
# Uncomment if necessary however generally it will be regenerated when needed | |
#!**/packages/repositories.config | |
# NuGet v3's project.json files produces more ignoreable files | |
*.nuget.props | |
*.nuget.targets | |
# Microsoft Azure Build Output | |
csx/ | |
*.build.csdef | |
# Microsoft Azure Emulator | |
ecf/ | |
rcf/ | |
# Windows Store app package directories and files | |
AppPackages/ | |
BundleArtifacts/ | |
Package.StoreAssociation.xml | |
_pkginfo.txt | |
# Visual Studio cache files | |
# files ending in .cache can be ignored | |
*.[Cc]ache | |
# but keep track of directories ending in .cache | |
!*.[Cc]ache/ | |
# Others | |
ClientBin/ | |
~$* | |
*~ | |
*.dbmdl | |
*.dbproj.schemaview | |
*.pfx | |
*.publishsettings | |
node_modules/ | |
orleans.codegen.cs | |
# Since there are multiple workflows, uncomment next line to ignore bower_components | |
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) | |
#bower_components/ | |
# RIA/Silverlight projects | |
Generated_Code/ | |
# Backup & report files from converting an old project file | |
# to a newer Visual Studio version. Backup files are not needed, | |
# because we have git ;-) | |
_UpgradeReport_Files/ | |
Backup*/ | |
UpgradeLog*.XML | |
UpgradeLog*.htm | |
# SQL Server files | |
*.mdf | |
*.ldf | |
# Business Intelligence projects | |
*.rdl.data | |
*.bim.layout | |
*.bim_*.settings | |
# Microsoft Fakes | |
FakesAssemblies/ | |
# GhostDoc plugin setting file | |
*.GhostDoc.xml | |
# Node.js Tools for Visual Studio | |
.ntvs_analysis.dat | |
# Visual Studio 6 build log | |
*.plg | |
# Visual Studio 6 workspace options file | |
*.opt | |
# Visual Studio LightSwitch build output | |
**/*.HTMLClient/GeneratedArtifacts | |
**/*.DesktopClient/GeneratedArtifacts | |
**/*.DesktopClient/ModelManifest.xml | |
**/*.Server/GeneratedArtifacts | |
**/*.Server/ModelManifest.xml | |
_Pvt_Extensions | |
# Paket dependency manager | |
.paket/paket.exe | |
paket-files/ | |
# FAKE - F# Make | |
.fake/ | |
# JetBrains Rider | |
.idea/ | |
*.sln.iml | |
# CodeRush | |
.cr/ | |
# Python Tools for Visual Studio (PTVS) | |
__pycache__/ | |
*.pyc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment