Skip to content

Instantly share code, notes, and snippets.

@benjaminxscott
Last active December 2, 2015 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjaminxscott/6ec4c9a0232c470bca16 to your computer and use it in GitHub Desktop.
Save benjaminxscott/6ec4c9a0232c470bca16 to your computer and use it in GitHub Desktop.
how to check out specific files from another branch, if those files have since moved
git clone $myrepo.git
# bring repo up to date
git checkout master
git pull
# change to PR branch
git checkout reorg_issues_dir
# move test out of the "new folder" created in PR
# since master doesn't know about the new folder
git mv $folder_with_changes .
# bring in our changes
git checkout master $folder_with_changes
# move them back to the "new folder"
git mv issue_* issues
# add changes to the PR
git commit issues/ -m "reflect latest tests"
# push to the PR
git push origin reorg_issues_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment