From 07dc35e4ad00486abec08d9d3b4bd5190bc8e402 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Thu, 10 Nov 2016 17:53:02 -0800 Subject: [PATCH] Add .gitattributes file, treat .pbxproj as binary Summary: By default, the `.pbxproj` file generated by React Native should be treated as binary data to prevent Git from possibly automatically converting or fixing CRLF issues with this file, which would break it. See https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#identifying-binary-files-znTLIVhvhG (where it specifically mentions `.pbxproj` files) for more information. Closes https://github.com/facebook/react-native/pull/10864 Differential Revision: D4162492 fbshipit-source-id: 2c8f2f0ab2bb41c23b1460ef6cba672ef38f6310 --- local-cli/generator/index.js | 4 ++++ local-cli/generator/templates/_gitattributes | 1 + 2 files changed, 5 insertions(+) create mode 100644 local-cli/generator/templates/_gitattributes diff --git a/local-cli/generator/index.js b/local-cli/generator/index.js index 800e3b2506c..1899b35fe47 100644 --- a/local-cli/generator/index.js +++ b/local-cli/generator/index.js @@ -111,6 +111,10 @@ module.exports = yeoman.generators.NamedBase.extend({ this.templatePath('_gitignore'), this.destinationPath('.gitignore') ); + this.fs.copy( + this.templatePath('_gitattributes'), + this.destinationPath('.gitattributes') + ); this.fs.copy( this.templatePath('_watchmanconfig'), this.destinationPath('.watchmanconfig') diff --git a/local-cli/generator/templates/_gitattributes b/local-cli/generator/templates/_gitattributes new file mode 100644 index 00000000000..d895c194714 --- /dev/null +++ b/local-cli/generator/templates/_gitattributes @@ -0,0 +1 @@ +*.pbxproj binary