Skip to content

Instantly share code, notes, and snippets.

@gwillcox-r7
Created December 30, 2022 22:51
Show Gist options
  • Save gwillcox-r7/990e02fa6f0cdd4cae3b5370a6420c62 to your computer and use it in GitHub Desktop.
Save gwillcox-r7/990e02fa6f0cdd4cae3b5370a6420c62 to your computer and use it in GitHub Desktop.
My Git Config and Aliases
[user]
name = Grant Willcox
email = [email protected]
signingkey = 3198961E148FF5E527E31A5FD35E05C0F2B81E83
[commit]
gpgsign = true
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
url = [email protected]:gwillcox-r7/metasploit-framework
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "upstream"]
url = [email protected]:rapid7/metasploit-framework.git
fetch = +refs/heads/*:refs/remotes/upstream/*
fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*
gh-resolved = base
[branch "upstream-master"]
remote = upstream
merge = refs/heads/master
[alias]
abandon = reset --hard HEAD
amend = commit --amend
branch-current = !"git branch | awk '/^\\*/ {print $2}'"
bv = branch -vv
checkout-pr = !"f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
checkout-prev-commit = checkout HEAD^
diffstat = diff --stat -r
pr-merge = !"git update && git checkout upstream-master && git rebase upstream/master && git merge -S --no-ff --edit"
pr-land = "push upstream upstream-master:master"
push-contrib = "!git push [email protected]:$1/metasploit-framework HEAD:$2 #"
log-merges = log --merges
log-mine = !"git log --author=\"$(git config user.name)\""
log-today = log --since="6am"
log-unpushed = log @{upstream}..HEAD
ls = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
mergex = "merge --edit --no-ff --gpg-sign"
patch-apply = !"patch -p0 < $1 #"
patch-make = diff HEAD --no-prefix
publish = push upstream upstream-master:master
snapshot = !"git stash save \"snapshot: $(date)\" && git stash apply \"stash@{0}\""
snapshots = !"git stash list --grep snapshot"
stash-unstaged = stash --keep-index
tag-version = !"git tag -s -m \"Version $1\" v$1 #"
unadd = reset HEAD
update-pr = !"f() { git pull ${2:-origin} refs/pull/$1/head:pr/$1; }; f"
update = !"git checkout upstream-master && git pull && git checkout master && git rebase upstream-master && git push"
[submodule "external/source/ReflectiveDLLInjection"]
active = true
url = https://github.com/rapid7/ReflectiveDLLInjection.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment