Skip to content

Instantly share code, notes, and snippets.

@BenGitsCode
Last active February 17, 2017 01:06
Show Gist options
  • Save BenGitsCode/be33f199cb009ed772b39c01b942d0a5 to your computer and use it in GitHub Desktop.
Save BenGitsCode/be33f199cb009ed772b39c01b942d0a5 to your computer and use it in GitHub Desktop.
Ben's Git Snippets and such

I use this to clean up all files ending in ".orig":

function git-clean-orig {
    git status -su | grep -e"\.orig$" | cut -f2 -d" " | xargs rm -r
}

If you are a scaredy-cat :) you could leave the last part off just to list them (or leave off the -r if you want to approve each delete):

function git-show-orig {
    git status -su | grep -e"\.orig$" | cut -f2 -d" "
}
# DiffMerge diff and merge tools
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
[merge]
tool = diffmerge
[mergetool "diffmerge"]
cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
trustExitCode = true
#This works well for me, make sure you install on MacOs using installer NOT DMG. Had many issues getting that working properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment