Less commonly used git commands
- 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
- 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:
- https://stackoverflow.com/questions/14947789/github-clone-from-pull-request
- https://stackoverflow.com/questions/3334475/git-how-to-update-checkout-a-single-file-from-remote-origin-master