Loading

Paste #ptxaiabe0

  1. [21:59 lordaro@Donald coding] > git init git-test
  2. Initialized empty Git repository in /home/lordaro/coding/git-test/.git/
  3. [21:59 lordaro@Donald coding] > cd git-test/
  4. [21:59 lordaro@Donald git-test] > ls
  5. [21:59 lordaro@Donald git-test] > vim file
  6. [22:00 lordaro@Donald git-test] > git add file
  7. [22:00 lordaro@Donald git-test] > git commit -m "init"
  8. [master (root-commit) 4ebeefd] init
  9.  1 file changed, 1 insertion(+)
  10.  create mode 100644 file
  11. [22:00 lordaro@Donald git-test] > git checkout -b n1
  12. Switched to a new branch 'n1'
  13. [22:06 lordaro@Donald git-test] > vim file
  14. [22:06 lordaro@Donald git-test] > git add -u
  15. [22:06 lordaro@Donald git-test] > git cim "x1"
  16. [n1 144b75a] x1
  17.  1 file changed, 1 insertion(+), 1 deletion(-)
  18. [22:07 lordaro@Donald git-test] > vim file
  19. [22:07 lordaro@Donald git-test] > git cam "x2"
  20. [n1 020d1aa] x2
  21.  1 file changed, 1 insertion(+), 1 deletion(-)
  22. [22:07 lordaro@Donald git-test] > git checkout -b n2
  23. Switched to a new branch 'n2'
  24. [22:07 lordaro@Donald git-test] > vim file
  25. [22:07 lordaro@Donald git-test] > git cam "x3"
  26. [n2 3864bf0] x3
  27.  1 file changed, 1 insertion(+), 1 deletion(-)
  28. [22:08 lordaro@Donald git-test] > vim  file
  29. [22:08 lordaro@Donald git-test] > git cam "x4"
  30. [n2 6d8a031] x4
  31.  1 file changed, 1 insertion(+), 1 deletion(-)
  32. [22:08 lordaro@Donald git-test] > # oh noes, a review, we need a new commit before x1
  33. [22:08 lordaro@Donald git-test] > git co n1
  34. Switched to branch 'n1'
  35. [22:08 lordaro@Donald git-test] > git co n2
  36. Switched to branch 'n2'
  37. [22:10 lordaro@Donald git-test] > git lg -5
  38. * 6d8a031 - (HEAD -> n2) x4 (2 minutes ago)<Charles Pigott>
  39. * 3864bf0 - x3 (2 minutes ago)<Charles Pigott>
  40. * 020d1aa - (n1) x2 (3 minutes ago)<Charles Pigott>
  41. * 144b75a - x1 (4 minutes ago)<Charles Pigott>
  42. * 4ebeefd - (master) init (11 minutes ago)<Charles Pigott>
  43. [22:10 lordaro@Donald git-test] > git co n1
  44. Switched to branch 'n1'
  45. [22:10 lordaro@Donald git-test] > git lg -5
  46. * 020d1aa - (HEAD -> n1) x2 (3 minutes ago)<Charles Pigott>
  47. * 144b75a - x1 (4 minutes ago)<Charles Pigott>
  48. * 4ebeefd - (master) init (11 minutes ago)<Charles Pigott>
  49. [22:11 lordaro@Donald git-test] > vim file
  50. [22:20 lordaro@Donald git-test] > git cam "y1"
  51. [n1 a539601] y1
  52.  1 file changed, 1 insertion(+), 1 deletion(-)
  53. [22:20 lordaro@Donald git-test] > git rebase -i master # reorder commits
  54. error: could not apply a539601... y1
  55.  
  56. When you have resolved this problem, run "git rebase --continue".
  57. If you prefer to skip this patch, run "git rebase --skip" instead.
  58. To check out the original branch and stop rebasing, run "git rebase --abort".
  59. Could not apply a539601df7356a15586c8ec6c752d5c2ae944cad... y1
  60. [22:20 lordaro@Donald git-test] > vim file
  61. [22:20 lordaro@Donald git-test] > git add -u
  62. [22:20 lordaro@Donald git-test] > git rebase --continue
  63. [detached HEAD ee36328] y1
  64.  1 file changed, 1 insertion(+), 1 deletion(-)
  65. error: could not apply 144b75a... x1
  66.  
  67. When you have resolved this problem, run "git rebase --continue".
  68. If you prefer to skip this patch, run "git rebase --skip" instead.
  69. To check out the original branch and stop rebasing, run "git rebase --abort".
  70. Could not apply 144b75a40abf59482fda5019f9f5c2c8201b0a3a... x1
  71. [22:21 lordaro@Donald git-test] > vim file
  72. [22:21 lordaro@Donald git-test] > git add -u
  73. [22:21 lordaro@Donald git-test] > git rebase --continue
  74. [detached HEAD 3533c6a] x1
  75.  1 file changed, 1 insertion(+), 1 deletion(-)
  76. Successfully rebased and updated refs/heads/n1.
  77. [22:21 lordaro@Donald git-test] > git lg -5
  78. * b17aa11 - (HEAD -> n1) x2 (5 seconds ago)<Charles Pigott>
  79. * 3533c6a - x1 (6 seconds ago)<Charles Pigott>
  80. * ee36328 - y1 (22 seconds ago)<Charles Pigott>
  81. * 4ebeefd - (master) init (21 minutes ago)<Charles Pigott>
  82. [22:21 lordaro@Donald git-test] > git checkout n2
  83. Switched to branch 'n2'
  84. [22:21 lordaro@Donald git-test] > git lg -5
  85. * 6d8a031 - (HEAD -> n2) x4 (13 minutes ago)<Charles Pigott>
  86. * 3864bf0 - x3 (13 minutes ago)<Charles Pigott>
  87. * 020d1aa - x2 (14 minutes ago)<Charles Pigott>
  88. * 144b75a - x1 (14 minutes ago)<Charles Pigott>
  89. * 4ebeefd - (master) init (21 minutes ago)<Charles Pigott>
  90. [22:21 lordaro@Donald git-test] > # ^ note the hashes - these are the "old" commits from before
  91. [22:22 lordaro@Donald git-test] > # n1 was rebased (and rewritten)
  92. [22:22 lordaro@Donald git-test] > git rebase -i n1
  93. Successfully rebased and updated refs/heads/n2.
  94. [22:23 lordaro@Donald git-test] > git lg -5
  95. * 0c91533 - (HEAD -> n2) x4 (9 seconds ago)<Charles Pigott>
  96. * f7733cc - x3 (10 seconds ago)<Charles Pigott>
  97. * b17aa11 - (n1) x2 (2 minutes ago)<Charles Pigott>
  98. * 3533c6a - x1 (2 minutes ago)<Charles Pigott>
  99. * ee36328 - y1 (2 minutes ago)<Charles Pigott>
  100. [22:23 lordaro@Donald git-test] > # tada! how did i do this? by the magic of deleting the old "dead" commits
  101. [22:23 lordaro@Donald git-test] > # from the rebase list, as those are old commits and we don't want those anymore
  102. [22:24 lordaro@Donald git-test] >

Comments