Saturday, 1 December 2012

GIT - Config File Changes with Aliases

 There are THREE files where git config search for configuration options.

Repository specific configuration file. (The filename is relative to the repository root, not the working directory.)
User-specific configuration file. Also called "global" configuration file.
System-wide configuration file.
 We can override the config file rules either by command line options or by environment variables.

The --global and the --system options will limit the file used to the global or system-wide file respectively.

Sample GIT Config File Rules - Which we can override in any one of the above location (.git/config).

    name = YourFirstname Lastname
    email = yourmailid
    ui = auto
[color "branch"]
    current = yellow reverse
    local = yellow
    remote = green
[color "diff"]
    meta = yellow bold
    frag = magenta bold
    old = red bold
    new = green bold
[color "status"]
    added = yellow
    changed = green
    untracked = cyan
    st = status
    com = commit
    br = branch
    co = checkout
    df = diff
    dc = diff --cached
    lg = log -p
    lol = log --graph --decorate --pretty=oneline --abbrev-commit
    lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
    ls = ls-files
    excludesfile = /Users/gitusername/.gitignore
    filemode = false
    mergeoptions = ff--only
[difftool "sourcetree"]
    cmd = opendiff \"$LOCAL\" \"$REMOTE\"
    path =
[mergetool "sourcetree"]
    cmd = /Applications/ \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
    trustExitCode = true

No comments:

Post a Comment

Thank you so much for providing your valuable feedback. I will will look into them and update my skills & technologies accordingly.