Mac specific optimizations in ~/.gitconfig

I read that discussion about the content of “~/.gitconfig” on Linux:

I know some Mac specific optimizations, such as using “mate” as default editor:

  • Force Git Pull to fail if a file is locked by another process
  • configure Jenkins “Global Tool Configuration” using CLI / groovy
  • Django Separate local and global configuration
  • Heroku error: “Permission denied (public key)”
  • Branch-specific configuration file maintenance with git
  • Problems occurred when invoking code from plug-in: “org.eclipse.jface”
  • [core]
        editor = mate -w

    or using opendiff as diff editor:

        external = opendiff

    Do you know other Mac specific optimizations (and/or tools) that I could install/configure in “~/.gitconfig” file in order to get a very user-friendly git?

  • git fetch shows nothing on console
  • Managing many git repositories
  • Download a single folder or directory from a GitHub repo
  • git add . crashes and git commit -a crashes
  • Completely replace remote branch with another in github leaving no traces of the old one
  • How can I use Git to identify function changes across different revisions of a repository?
  • 3 Solutions collect form web for “Mac specific optimizations in ~/.gitconfig”

    I prefer to keep the default diff command internal, for quick summaries at the terminal, and access the more advanced diff programs (I use MacVim) using the difftool commmand. I describe the set up procedure here. The Mac-specific part is in my wrapper script, where I facultatively launch MacVim if it is available, then default to regular Vim. You can adapt to use TextMate, of course, if that is your preference.

    I use opendiff and textmate as external tools for git. You can configure them by running the following commands in bash:

    #TextMate as the default editor
    git config --global core.editor "mate -w"
    #Opendiff (FileMerge) to resolve merge conflicts:
    git config --global merge.tool opendiff
    #Opendiff (FileMerge) as diff tool
    git config --global diff.tool opendiff

    Alternatively you can configure the gitconfig file by adding the following:

        tool = opendiff
        tool = opendiff
        editor = mate -w

    The difftool and mergetool is only available after version 1.6.3

    Since git reuses the same temporary file for commit messages, I recommend using

        editor = mate -wl1

    so TextMate puts the cursor onto the first line every time instead of remembering the cursor position from last time.

    And if you create the following shell script…

    # ~/bin/
    /usr/bin/opendiff "$2" "$5" -merge "$1"

    …and configure git to use it as external diff tool…

    $ git config --global diff.external ~/bin/

    …you can use opendiff for diffs and merges.

    Git Baby is a git and github fan, let's start git clone.