Git forensics: all changes on dev branch disappeared after merge into master

Joshua R.

My team just discovered that all changes (edits, added files) from a development branch disappeared when that branch was merged into "master".

-- A --- B --- D --   "master"
    \         /
      -- C --       "dev"

git diff D B shows no differences.

git diff D C shows lots of differences.

There should have been no merge conflicts.

The merge was probably performed using SourceTree.

Is there a simple explanation for how such a thing might have happened? We'd like to avoid doing it again.

Thanks!

jthill

The only way to get that in Git is by explicitly asking for it. There are various ways to do it, there's various workflows for which that's a legitimate merge result, but it's not the default and you can't just fatfinger the request, you have to ask for it. One way is a -s ours merge. Another is to do a git reset HEAD before committing the merge. If SourceTree makes it easy to fatfinger that, that's on them.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Need to merge a git branch forcefully onto the master after svn import

分類Dev

Git merge master into feature branch

分類Dev

github. How would one merge all changes from the master branch into another branch?

分類Dev

files changes when merge branch to master

分類Dev

Git: What happens to a branch after a master reset

分類Dev

Can't merge master to feature branch after reverting a pushed merge

分類Dev

git checkout master automatically moves my other not committed branch changes

分類Dev

Git: Squash feature branch and merge commit, rebase on master

分類Dev

git abandon master branch

分類Dev

git master branch is crazy

分類Dev

git pull origin master marks changes from master as modified in my feature branch

分類Dev

Master and branch showing the same changes

分類Dev

Is it safe in Git to pre-merge master into my feature branch before final merge?

分類Dev

Merge a branch from another branch in master

分類Dev

How can I create merge requests after having updated my master branch?

分類Dev

How can I selectively merge or pick changes from another branch in Git?

分類Dev

Merge svn branch to new git branch

分類Dev

deleting a remote branch after merge

分類Dev

git merge origin / branch vs. merge branch local

分類Dev

got 'fatal: branch 'master' does not exist' in git

分類Dev

Git push master fatal: You are not currently on a branch

分類Dev

Delete branch after checkout from the master

分類Dev

How to point branch to master after rebase complete

分類Dev

How to rebase a branch after its base branch was rebased on master

分類Dev

Git - Committing only my changes to a remote branch

分類Dev

Git - What happens to my local master branch after a pull request? How do I manage multiple in progress branches?

分類Dev

How to merge branch in git using `their` when in conflict

分類Dev

Rebase or Merge Git branch but Keep Deleted Files

分類Dev

Eclipse Git - switch branch without merge

Related 関連記事

  1. 1

    Need to merge a git branch forcefully onto the master after svn import

  2. 2

    Git merge master into feature branch

  3. 3

    github. How would one merge all changes from the master branch into another branch?

  4. 4

    files changes when merge branch to master

  5. 5

    Git: What happens to a branch after a master reset

  6. 6

    Can't merge master to feature branch after reverting a pushed merge

  7. 7

    git checkout master automatically moves my other not committed branch changes

  8. 8

    Git: Squash feature branch and merge commit, rebase on master

  9. 9

    git abandon master branch

  10. 10

    git master branch is crazy

  11. 11

    git pull origin master marks changes from master as modified in my feature branch

  12. 12

    Master and branch showing the same changes

  13. 13

    Is it safe in Git to pre-merge master into my feature branch before final merge?

  14. 14

    Merge a branch from another branch in master

  15. 15

    How can I create merge requests after having updated my master branch?

  16. 16

    How can I selectively merge or pick changes from another branch in Git?

  17. 17

    Merge svn branch to new git branch

  18. 18

    deleting a remote branch after merge

  19. 19

    git merge origin / branch vs. merge branch local

  20. 20

    got 'fatal: branch 'master' does not exist' in git

  21. 21

    Git push master fatal: You are not currently on a branch

  22. 22

    Delete branch after checkout from the master

  23. 23

    How to point branch to master after rebase complete

  24. 24

    How to rebase a branch after its base branch was rebased on master

  25. 25

    Git - Committing only my changes to a remote branch

  26. 26

    Git - What happens to my local master branch after a pull request? How do I manage multiple in progress branches?

  27. 27

    How to merge branch in git using `their` when in conflict

  28. 28

    Rebase or Merge Git branch but Keep Deleted Files

  29. 29

    Eclipse Git - switch branch without merge

ホットタグ

アーカイブ