I am starting off on a React Native project on multiple computers. I'm fairly new to React Native, hence probably this newb question :
What is the minimum of files I need to track with Git in order to be able to sync and work on multiple computers? The whole folder? Can I leave out the platform specific build dirs (ios
, android
) and have a script recreate those after a git pull origin
?
You can look at this from a different perspective:
gitignore.io/api/reactnative
lists the files/folders you need to not track (ignore)
So simply add the rest (after creating a .gitignore
for your react application).
As the OP El Dude mentions in the comments, the react-native eject
command can come in handy.
As described in this gist:
If your project has any issues with the native folders, you can rebuild them by deleting both the
ios
andandroid
directories at the root level of your project and running this command:
$ react-native eject
Running this command will check if the ios and android directories exist and then rebuild whichever one is missing.
More generally, any folder that you can generate does not have to be part of your Git repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With