Skip to content

Instantly share code, notes, and snippets.

@chrismo
Created September 28, 2012 16:55
Show Gist options
  • Select an option

  • Save chrismo/3800936 to your computer and use it in GitHub Desktop.

Select an option

Save chrismo/3800936 to your computer and use it in GitHub Desktop.
Non-merging copying over of changes from branch to branch
If file exists in both places:
git diff target_branch source_branch relative_path_to_file | git apply
If file is new on other branch:
git checkout source_branch relative_path_to_file
The checkout will work even if the file exists, and will stomp it,
not diff into it, so be careful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment