Skip to content

Git General Prerequisites

Kenneth Kasajian edited this page Aug 4, 2020 · 33 revisions
  1. Install Git
  1. Introduce yourself:

     git config --global user.name "Your Name Comes Here"
     git config --global user.email [email protected]
    
  2. Set up Editor. Pick your favorite:

  • OS X:

    git config --global --add core.editor "open -W -e -n"

  • Windows:

    git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

      or
    

    git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

  • Generic:

     `git config --global core.editor 'vim'`
    
      or
    
     `git config --global core.editor emacs`
    
  1. Set up diff and merge tools:

     git config --global diff.tool winmerge
     git config --global difftool.prompt false
     git config --global difftool.winmerge.cmd "WinMergeU.exe -r -u -e -dl Local -dr Remote \"$LOCAL\" \"$REMOTE\""
    
     git config --global merge.tool kdiff3
     git config --global mergetool.kdiff3.cmd "kdiff3 $BASE $LOCAL $REMOTE -o $MERGED"
    
     git config --global merge.tool winmerge
     git config --global mergetool.prompt false
     git config --global mergetool.winmerge.trustExitCode true
     git config --global mergetool.winmerge.cmd "WinMergeU.exe -r -u -e -dl Local -dr Remote \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
    
  2. Color Options:

     git config --global color.diff auto
     git config --global color.status auto
     git config --global color.branch auto
    
     git config --global color.status.untracked "red bold"
     git config --global color.status.added "green bold"
     git config --global color.status.changed "magenta bold"
    
    git config --global alias.logs "log --graph --pretty=format:%C(auto)%h_%d%s_%C(green)(%cd)_%C(cyan)<%an>%Creset --date=local"

6.5 Common settings:

    git config --global push.followTags true
  1. Do this to avoid 'SSL certificate problem: unable to get local issuer certificate'

    git config --global http.sslVerify false
    
  2. Proxy set up:

    git config --global http.proxy http://127.0.0.1:9000
    

    to access internet git sites through a proxy server.

    git may also use environment variables:

    set HTTP_PROXY=http://127.0.0.1:9000
    

    to tell git to bypass the proxy server for certain remotes on a per-repository basis, replace "origin" with the name of the remote:

    git config --add remote.origin.proxy ""
    

References
Clone this wiki locally