Chia sẻ cấu hình Git

Khi thay đổi môi trường development, tôi phải cấu hình lại Git. Để tiết kiệm thời gian, tôi lưu bản copy của file cấu hình Git. Khi chuyển sang máy mới, tôi chỉ cần bỏ nó vào thư mục user của Windows là xong.

Dưới đây là nội dung file .gitconfig tôi đang dùng. Nó gồm các lệnh tắt để chạy chức năng thông dụng của Git như commit hoặc hiển thị log dưới dạng cây.

[alias]
    lg = log --color --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
    lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
    llg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    s = status -s
    st = status
    co = checkout
    cma = commit -am
    d = diff --word-diff
    qm = "!git checkout $1;git merge @{-1}"
    m = merge
    r = rebase
    pr = pull --rebase
    ba = branch -a
    bd = branch -d
    p = pull
[http]
    sslVerify = false