git rebase - deptno/deptno.github.io GitHub Wiki

git-rebase

컀밋 ν•΄μ‹œκ°€ λ³€κ²½λ˜μ§€ μ•ŠλŠ” 경우

rebase -i @~n 을 톡해 λ³€κ²½μ‹œμ— 컀밋 λ©”μ‹œμ§€λ§Œμ„ λ³€κ²½ν•˜λ©΄ commit hash λŠ” λ³€κ²½λ˜μ§€ μ•ŠλŠ”λ‹€

error

$ git rebase --abort
warning: could not read '.git/rebase-merge/head-name': No such file or directory
$ git rebase --quit
$ git rebase --onto TAG @~ @ # νŠΉμ • νƒœκ·Έ μœ„μΉ˜μ— ν—€λ“œ 컀밋 ν•˜λ‚˜λ₯Ό μ΄λ™μ‹œν‚΄, cherry pick κ³Ό κ°™μŒ
$ git rebase --onto F D
#         Before                           After
#   A---B---C---F---G (branch)        A---B---C---F---G (branch)
#            \                                     \
#             D---E---H---I (HEAD)                  E---H---I (HEAD)
#
$ git rebase --onto F D H
#         Before                                     After
#   A---B---C---F---G (branch)                A---B---C---F---G (branch)
#            \                                             \
#             D---E---H---I (HEAD)                          E---H (HEAD)

link