Skip to content
fraschfn edited this page Aug 2, 2012 · 2 revisions
  1. add a file 1.txt with lines 1-10

  2. commit

  3. create two branches branchTarget and branchSource

  4. switch to branchTarget

  5. rename file 1.txt to 2.txt

    optionally: edit line 1

  6. commit

  7. checkout branchSource

  8. edit line 5

  9. commit

  10. edit line 8

  11. commit

  12. add branch branchSourceTemp on branchSource

  13. git rebase branchTarget branchSourceTemp

    alternatively if not only a rename but also changes occurred:

    git rebase --strategy="recursive" --strategy-option="rename-threshold=25" branchTarget branchSourceTemp

  14. git rebase --onto branchTarget branchSourceTemp~ branchSourceTemp

in branchSourceTemp the file 2.txt contains only the modification of line 8 (and the optionally change on line 1)

Clone this wiki locally