Last active
March 21, 2017 09:37
-
-
Save ncuillery/4b09e36d772601301cf0d0c94dcde692 to your computer and use it in GitHub Desktop.
Upgrade React Native on your project, using a git-like interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In the root directory of a project, the Git working copy must be clean: | |
echo "a" | react-native upgrade # Generate the current version template and overwrite all files | |
git add . | |
git commit -m "Old version" # The current version template is added to the index | |
npm i react-native@latest --save # Install the new version of React Native | |
echo "a" | react-native upgrade # Generate the new version template and overwrite all files | |
git add . | |
git commit -m "New version" # Same as before, the new version template is added to the index | |
git diff HEAD~1 HEAD > upgrade.patch # Output the diff, totally suitable for the user's project | |
git reset HEAD~2 --hard # Go back to the source before the 2 upgrade commits | |
git apply upgrade.patch --3way # Git is able to perform a 3-way because the 3 versions of each files have an entry in the index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment