[color] ui = true [push] default = simple [alias] # Common Shorthands # ----------------- a = add c = commit ca = commit --amend co = checkout cod = !sh -c 'git checkout $(git default)' cp = cherry-pick cpc = cherry-pick --continue d = diff lg = log --format=\"%w(92,0,21)%C(yellow)%h %Cgreen%<(12)%an %Creset%s\" --graph mv = branch --move pl = pull ps = push rb = rebase rbc = rebase --continue st = status -sb helper = osxkeychain # Workflow Macros # --------------- # If you see the following ERROR message: # fatal: ref refs/remotes/origin/HEAD is not a symbolic ref # # Run the following command: # (replace "master" with your default branch name if it is different) # echo "ref: refs/remotes/origin/master" > .git/refs/remotes/origin/HEAD # print name of default branch (typically develop or master) default = !sh -c 'git symbolic-ref refs/remotes/origin/HEAD | sed "s@^refs/remotes/origin/@@"' - # fetch-origin-merge-origin: update feature branch with latest changes from default branch fomo = !sh -c '\ BRANCH=${1:-$(git default)} && \ echo "Merging latest $BRANCH..." && \ git fetch origin $BRANCH && \ git merge --no-ff FETCH_HEAD' - # start a feature branch start = checkout -b # finish a feature branch: delete it, checkout default, pull latest finish = !sh -c '\ CURRENT=$(git rev-parse --abbrev-ref HEAD) && \ BRANCH=${1:-$(git default)} && \ echo "Finishing feature branch $CURRENT into $BRANCH..." && \ git checkout $BRANCH && \ git branch -D $CURRENT && git pull' - # "squash last 4 commits" = g sq 4 sq = !sh -c 'git rebase -i HEAD~$0' # diff-so-fancy: better console colors # https://github.com/so-fancy/diff-so-fancy [core] pager = diff-so-fancy | less --tabs=4 -RFX [color "diff-highlight"] newHighlight = green bold 22 newNormal = green bold oldHighlight = red bold 52 oldNormal = red bold [color "diff"] commit = 227 bold frag = magenta bold meta = 227 new = green bold old = red bold whitespace = red reverse