Skip to content

Instantly share code, notes, and snippets.

@rnagle
Created November 25, 2015 16:12
Show Gist options
  • Save rnagle/8599f3a6f3de8b3ccd9f to your computer and use it in GitHub Desktop.
Save rnagle/8599f3a6f3de8b3ccd9f to your computer and use it in GitHub Desktop.

Revisions

  1. rnagle created this gist Nov 25, 2015.
    18 changes: 18 additions & 0 deletions gitconf.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/bin/bash

    function gitconf() {
    if [[ -d .git ]]
    then
    echo ".git/config"
    return 0;
    fi

    if [[ -f .git ]]
    then
    echo "$(cat .git | awk '{print $2}')/config"
    return 0;
    fi

    echo "Must be run from a git repository"
    return 1;
    }