Answer the question
In order to leave comments, you need to log in
How to get the end situation from the start situation?
Hi all!
Please tell me how to use the commands in git from the start situation (Fig. 15) to make the end situation (Fig. 16)?
I myself solved this problem using a temporary branch from a C3 commit like this:
1. Switch to a C3 commit and create a temporary TEMP branch:
$ git checkout C3
$ git checkout –b TEMP
3. Perform changes and commit:
$ git commit –am “C10
4. Switch to branch F3 and rebase to TEMP (resolve conflicts if any):
$ git
checkout F3
$ git rebase
TEMP C9':
$ git branch –f TEMP C9'
6. Delete the TEMP branch:
$ git branch –d TEMP
7. Move commit C4:
$ git cherry-pick C4
Answer the question
In order to leave comments, you need to log in
There are options. I came up with this, rather extravagant:
$ git checkout F1
$ git reset --hard HEAD^ (первые две команды можно заменить на git checkout -B F1 C3)
$ git commit –am “C10”
$ git checkout F3
$ git rebase F1
$ git cherry-pick C4
$ git checkout -B F1 C4
git reflog
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question