Skip to content

Instantly share code, notes, and snippets.

@ygoex
Last active October 24, 2019 13:50
Show Gist options
  • Select an option

  • Save ygoex/ff15db228c9b760eff8bab53567ac524 to your computer and use it in GitHub Desktop.

Select an option

Save ygoex/ff15db228c9b760eff8bab53567ac524 to your computer and use it in GitHub Desktop.
gitconfig
[user]
name = Yolanda Gorriz Exposito
email = TO-DO
[core]
editor = code --wait
fileMode = false
[color "branch"]
current = yellow bold
local = green bold
remote = cyan bold
[color "diff"]
old = red bold
new = green bold
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[diff]
tool = vscode
[difftool "vscode"]
cmd = "code --wait --diff "
[branch "master"]
mergeoptions = --ff-only
[alias]
aa = add --all
a = add
# Amend the most recent commit message
amend = commit --amend -m
b = branch
# Remove a local branch
db = branch -d
c = commit
ca = commit -a
cm = commit -m
cam = commit -am
cl = clone
cp = cherry-pick
# -w flag is for without whitespaces
d = diff -w
f = fetch
l = log --oneline
lg = log --oneline --graph --decorate
ls = ls-files
m = merge
co = checkout
# Revert all changes in unstaged files
clean = checkout --.
# Creates a new branch
nb = checkout -b
com = checkout master
cod = checkout develop
pr = prune -v
ps = push
psf = push -f
# -u = upstream
pso = push -u origin
psom = push origin master
pl = pull
# Updating develop with its remote. The --rebase flag unsprisingly rebases the current branch on top of the upstream
# branch after fetching. This avoids a merge commit whenever I get up to date with the remote branch.
plr = pull --rebase
plo = pull origin
pbo = pull --rebase origin
plom = pull origin master
# https://medium.freecodecamp.org/an-introduction-to-git-merge-and-rebase-what-they-are-and-how-to-use-them-131b863785f
rb = rebase
# To rebase n commits. Usage: git rb 2
rbn = "!sh -c \"git rebase -i HEAD~$1\" -"
rod = rebase origin/develop
re = reset
s = status
# Deletes the last commit from history but keeps the changes in the index in case I want to do something with them
undo = reset --soft HEAD^
# To move things out of the index (the opposite of git add)
wait = reset HEAD
# Today’s Work
today = log --since=00:00:00 --all --no-merges --oneline --author=yolanda.goex@ed.ac.uk
# Remind What I’ve Been Up To
remind = log --all --oneline --no-merges --author=yolanda.goex@ed.ac.uk
# See What Everyone’s Been Getting Up To
people = log --all --since='2 weeks' --oneline --no-merges
# Who has committed how much to your project?
hm = shortlog -sn --since='10 weeks' --until='2 weeks'
# Show all branches
show = remote show origin
# shows a list of every thing you've done in git, across all branches!
# Each one has an index HEAD@{index} After finding the one before we broke everything do: git fix{index}
error = reflog
# Requires the index of the commit we want to go to
fix = reset HEAD@
# https://css-tricks.com/git-add-patch-mode/
patch = add -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment