Hello. There is the following branch:
* c9ec96c Some Changes in EG proj * 928b5ea Merge branch 'testHDFS' |\ | * 1504e3f Redact Task | * a9dffca Add xmlResult | * 82cd8fb EGp with MetaCode | * db93620 Add EG progect to test * | 536029f Redact Task * | 44cc081 Add xmlResult * | 370584a EGp with MetaCode * | 96c5388 Add EG progect to test |/ * 765ca4c v5HDFS * 5da3f2a v4HDFS * cedc686 v3HDFS * 28d0e1a v2HDFS * a6f9d63 v1HDFS * e5f373a v3 * 708e3b6 v2 * c89f76a First commit A branch from 765ca4c appeared after an attempt to rewrite the e-mail of the author of commits. Then merge of two identical kommit followed (probably in time did not merge all changes with github). It is necessary to remove the duplicate branch.
There were the following attempts to rectify the situation:
git rebase --onto c9ec96c 536029fas advised here . Result:First, rewinding head to replay your work on top of it ...
Fast-forwarded HEAD to c9ec96c.
git reset --hard 1504e3fremove the commit altogether (considering that this can lead to disastrous consequences)
UPD: Tried a method from @alexander barakin, here's what happened:
git checkout c9ec96сgit rebase -i 765ca4cpick 96c5388 Add EG progect to test pick 370584a EGp with MetaCode pick 44cc081 Add xmlResult pick 536029f Redact Task pick db93620 Add EG progect to test pick 82cd8fb EGp with MetaCode pick a9dffca Add xmlResult pick 1504e3f Redact Task pick c9ec96c Some Changes in EG projThen:
pick 96c5388 Add EG progect to test pick 370584a EGp with MetaCode pick 44cc081 Add xmlResult pick 536029f Redact Task pick c9ec96c Some Changes in EG proj :xSuccessfully rebased and updated detached HEAD.
git log --oneline --graph* f647a1b Some Changes in EG proj * 536029f Redact Task * 44cc081 Add xmlResult * 370584a EGp with MetaCode * 96c5388 Add EG progect to test * 765ca4c v5HDFS * 5da3f2a v4HDFS * cedc686 v3HDFS * 28d0e1a v2HDFS * a6f9d63 v1HDFS * e5f373a v3 * 708e3b6 v2 * c89f76a First commitgit checkout masterWarning: you are leaving 1 commit behind, not connected to any of your branches: f647a1b Some Changes in EG proj If you want to keep it by creating a new branch, this may be a good time to do so with: git branch <new-branch-name> f647a1b Switched to branch 'master' Your branch is up-to-date with 'origin/master'.git log --oneline --graph* c9ec96c Some Changes in EG proj * 928b5ea Merge branch 'testHDFS' |\ | * 1504e3f Redact Task | * a9dffca Add xmlResult | * 82cd8fb EGp with MetaCode | * db93620 Add EG progect to test * | 536029f Redact Task * | 44cc081 Add xmlResult * | 370584a EGp with MetaCode * | 96c5388 Add EG progect to test |/ * 765ca4c v5HDFS * 5da3f2a v4HDFS * cedc686 v3HDFS * 28d0e1a v2HDFS * a6f9d63 v1HDFS
I understand that a new branch has been created and I can switch to hash by head. But I do not understand why the old commits did not go away. I tried to drop them through rebase and reset. If you enter the rebase command for f647a1b (recalculated commit) , then it is looked at commits that are "above" c9ec96c . Apparently, the relocation did not happen to the end and a conflict appeared.
resetmasterpointer to any commit you can by using theresetcommand with the--hardoption:$ git checkout master && git reset --hard f647a1b. 2. “orphaned” commits will be deleted only after “garbage collection”. 3. since you rewrote history, to rewrite it in the “outside world”, thepushcommand will have to be done with the-foption. and I hope you know that rewriting the history in the repository, which is used by more than one committer, can make all your manipulations meaningless. - aleksandr barakin765ca4cand536029f. The problem really was that I switched from the relocation process to which branch. In order to avoid the "reset" relocation, you constantly had to callgit branchandgit status. After the resolution of all conflicts. everything went well. Thanks again. - Sanek Zhitnik