Y
Y
Yuri Pikhtarev2014-08-21 13:00:09
git
Yuri Pikhtarev, 2014-08-21 13:00:09

How to change the "start" commit of a git repository branch?

Please tell me about this issue.
In the git repository from the develop branch (commit AAA), the test branch was created. As such, there were no changes in the branch. After that, several commits were applied to the develop branch - BBB, CCC, DDD. A timely rebase / merge of the test branch was not made and an EEE commit was sent to the test branch.
The develop and test branches at that stage began to differ by exactly three missed commits - BBB, CCC, DDD. And everything would be relatively good, but now it’s time to merge the test branch with the develop branch, and because of the missing commits, it doesn’t seem possible to do this - hundreds of files conflict, it doesn’t seem possible to resolve conflicts (there was a change in line endings, you need to “solve” everything entire files).
Is it possible now (after dozens of commits to both the develop branch and the test branch) to make the test branch originate not from the AAA commit, but from the DDD commit? Then all the problems with merging branches will go away. I can’t do this, I’m completely confused with the commands with git rebase and git cherry-pick.
PS. The changes have been pushed to the remote repository across all branches. As a "backup" option for myself, I left the creation of a new branch, on which to manually roll all the changes of the test branch with patches

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
EXL, 2014-08-21
@EXL

there was a change in line endings, it is necessary to "solve" all the files in their entirety
But what if you try to commit "FFF" on the "EEE" commit of the "test" branch, which in essence will be "Fix CRLF to LF", that is, it simply contains the conversion of project code lines to LF. And then, respectively, try to merge the "test" and "develop" branches again? Then there should be no conflicts with line endings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question