Git

Tutorial

Commands

  1. To see git hitsory, run:
     $ git log --graph --oneline --decorate
    
  2. Set up user name/email address
     $ git config --global user.name <username>
     $ git config --global user.email <mailaddress>
    
  3. To save Git password
     $ git config --global credential.helper store
    

Configuration

  • Setup proxy configurations for Git when using Git behind a corporate proxy, e.g., http://10.0.0.0:8080/.
  • Assume you would like access all repositories via a corporate proxy, except certain repositories located at http://abc.com which needs to be accessed directly without going through a proxy.
  • To achieve this, create a .gitconfig file at ~/ such that ~/.gitconfig file contains the following.
      [user]
          email = name@email.com
          name = name
      [http]
          proxy = http://10.0.0.0:8080/
      [https]
          proxy = https://10.0.0.0:8080/
      [http "http://abc.com/"]
          proxy = 	    
    

Updated:

Leave a comment