Git pull and merge during a merge

With Git I have done a pull on the other developers branch, then I merged into my branch. When I ran the app I realized the other developer forgot to check in a new resource, he promptly checked it in. How do I grab that new file while I’m in the middle of a merge?

I don’t want to lose all the work I did with the mergetool by undoing what I have so far. I also don’t want to check it in as I can’t test it without the resource file and I don’t want to check in broken code.

  • A little git trouble
  • TFS Branch/Merge meets History View
  • determining which branches in conflict during an octopus merge
  • How to perform a three-way diff in Git without merging?
  • Git diff shows changes that aren't in a commit
  • Git: How to merge local branch with remote tracking automatically without fetching
  • git merge the current branch as second parent
  • What is the purpose of a separate merge commit in git?
  • 2 Solutions collect form web for “Git pull and merge during a merge”

    You could:

    • fetch (which doesn’t require that your working tree is clean, meaning your merge is still in progress)
    • checkout the file from origin/otherBranch (as in “How to get just one file from another branch”)

      git checkout origin/otherBranch -- aFile
      

    That would override ‘aFile‘ though, which means I assume your merge in progress doesn’t involve that file, or the work o it would be lost.

    As The OP Ian Hern mentions, you also can checkout the branch after pulling the other branch.
    Redoing a merge then can work.

    I was able to checkout that other branch, do a pull, and then checkout my mid-merge branch again. And then ran merge again and it added it in.

    Git Baby is a git and github fan, let's start git clone.