Problem
Say that I have done some work on master:
c1 <- c2
^
master
At this point, I disconnect and do another job:
test
v
c3 <- c4
c1 <- c2 /
^
master
Then do a git merge --no-ff( --no-ffto save the branch history):
test
v
c3 <- c4
c1 <- c2 / \ [c5]
^
master
( [c5]is a merge commit)
Then I delete the branch test, thinking that I am done with it. However, I believe that, in the end, there is a problem with the work that I did on test. I need to change c3, but without harming the history of the branches.
Things i tried
My attempt
I git checkout c3; , , git commit --amend. checkout master git branch temp c3. git rebase --preserve-merges temp: , , git add <file> git rebase --continue.
, git log --oneline --graph, - :
* [c5]
|\
| * c4
|/
* c3'
* c2
* c1
:
* [c5]
|\
| * c4
| * c3'
|/
* c2
* c1
c3' - .
git?
git checkout c3
git checkout -b test
git commit
git checkout master
git reset
git merge
, , c4. (, , , .) git log --oneline --graph :
* [c5]
|\
| * c3'
|/
* c2
* c1
[c5'] - . ( , , .)