Skip to content

Instantly share code, notes, and snippets.

View Lugoues's full-sized avatar

Peter Brunner Lugoues

  • ThorTech Solutions
  • New York
View GitHub Profile
@Lugoues
Lugoues / branch-fu.md
Created March 6, 2019 23:44 — forked from unbracketed/branch-fu.md
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
#!/bin/sh
# Use BeyondCompare as difftool for git in cygwin.
# git config --global difftool.bc3.cmd "beyondcompare-diff.sh \"\$LOCAL\" \"\$REMOTE\""
# git difftool -t bc3 branch1..branch2
# Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf
library=githelperfunctions.sh
#[ -f $library ] && . $library