Less commonly used git commands

  1. To clone from pull request XXX1 type the below commands into the terminal
     # git clone link-to-master-branch
     # change directory to master-branch
     git fetch origin pull/XXX/head:pull_XXX #XXX is the pull request number
     git checkout pull_XXX # pull_XXX is local branch name
    
  2. To update/checkout a single file from remote origin master2 type the below commands into the terminal
     # change directory to repo
     git fetch
     git checkout master <filepath> 
    

References:

  1. https://stackoverflow.com/questions/14947789/github-clone-from-pull-request
  2. https://stackoverflow.com/questions/3334475/git-how-to-update-checkout-a-single-file-from-remote-origin-master