github - Having problems with "git revert" after merging my branch -


i have 3 branches: master, , b.

branch "a" , "b" should independent each other. after pull requests, master got updated , b. now, have accidentally merged b a.

immediately, have reverted merge via git revert -m

but when pull b master, revert merge in destroys changes branch b. happening because of branch have "revert merge b" commit.

how can remove "revert merge branch b" , "merge branch b" commits? tried use git -rebase command, doesn't me, git creates anthoer branch not in pull request.

simple answer: git docs

revert revert because

so if think of "revert" "undo", you're going miss part of reverts. yes, undoes data, no, doesn't undo history.

adding more it:

unfortunately, hit the popular problem in history of git users :)

your problem faulty merge git merge branch b/branch a, tried recover git revert

remember, "revert" undoes data changes, it's not "undo" in sense doesn't undo effects of commit on repository history.

i think better person answer question linus torvalds, can't find better person him.

reverting regular commit undoes commit did, , straightforward. reverting merge commit undoes _data_ commit changed, absolutely nothing effects on _history_ merge had.  merge still exist, , still seen joining 2 branches together, , future merges see merge last shared state - , revert reverted merge brought in not affect @ all.  "revert" undoes data changes, it's _not_ "undo" in sense doesn't undo effects of commit on repository history.  if think of "revert" "undo", you're going miss part of reverts. yes, undoes data, no, doesn't undo history. 

some of links solving git revert problem:

  1. undo git merge (hasn't been pushed yet)

  2. git revert, reset , merge problems


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -