Thursday, February 24, 2011

[Git] Rebase

So far I have used git rebase for 3 scenarios.
  1. Want to add more change in the commit that is not the last commit of any branch. Use git rebase -i
  2. Want to move whole different branch to base on another branch.
          A---B---C topic
    /
    D---E---F---G master
    to
                  A'--B'--C' topic
    /
    D---E---F---G master
    git checkout <branch-to-move>
    git rebase <base-branch>
  3. Want to move part of different branch to base on another branch.
        o---o---o---o---o  master
    \
    o---o---o---o---o next
    \
    o---o---o topic
    to
    o---o---o---o---o  master
    | \
    | o'--o'--o' topic
    \
    o---o---o---o---o next
    git rebase --onto <new-base-branch> <old-base-branch> <move-branch>


No comments:

Clojure has lesser typing error problems than the others well-known dynamic typing languages

Give these snippets a try. // JS function foo () {   bar(1) } # Ruby def foo   bar(1) end ; Clojure (defn foo []    (bar 1)) As yo...