0

I am walking through the manual re-remerge documentation in the Git Book. When trying to do a merge-file on the three .rb files, Git complains.

 git merge-file -p simple.ours.rb simple.common.rb simple.theirs.rb > simple.rb
 error: cannot merge binary files: simple.ours.rb

From reading How to determine if Git handles a file as binary or as text? I understand that Git is detecting the files as binary instead of text.

Apparently, Git assesses as binary any files that have a NUL byte in the first 8000 characters. I have opened each *.rb file in notepad2 and vim, though, and do not see any NUL bytes. The files simply contain the following (with slight diffs):

#! /usr/bin/env ruby

# print a greeting
def hello
  puts 'hello world'
end

hello()

Some Notes:

  • I have repeatedly run both dos2unix and unix2dos on the *.rb files
  • I am working on a Windows machine with Posh-Git

Why is Git assessing these files as binary? How can I fix this?

Community
  • 1
  • 1
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467

0 Answers0