-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-native-git-upgrade deletes my non-versioned files and fails #12237
Comments
Ok I reproduced the deletion by running the Git commands manually, just like the tool does: https://gist.github.com/ncuillery/4b09e36d772601301cf0d0c94dcde692. I think I got it: The first step of the process consists in restoring the template of your current RN version, just like it would have been generated by the init command. So your From now on, At the end, the |
|
Also lost some files which were |
I'm assuming the files it obliterates are just as gone as if I'd run |
react-native-git-upgrade deletes my jks file. |
same , some gitignored files get deleted and I have to find them in my backups, pretty annoying if you dont expect it ... |
Ditto. I use react-native-config to store environment variables for development, staging, and production. Git upgrade wipes out these files since they are not committed to github (contain secrets). Pain in the butt to have to replace them every month when a new RN version comes out. |
I've started using rn-diff for upgrades, usually pretty quick and less frustrating to do it manually. https://github.com/ncuillery/rn-diff |
This is driving me nuts too! Every time I upgrade, my .env files and frameworks under ios/Frameworks are deleted (stuff under Frameworks is gitignore'd). First time build always fails before I remember to restore from backup... Will check out https://github.com/ncuillery/rn-diff |
Any update on this? Did you all end up switching to rn-diff? |
@Hauuguu I did, yes |
Same here, just lost all my files that were gitignored ... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
This is very much still happening to everyone who uses |
I stopped using react-native-git-upgrade in favor of rn-diff |
Summary: This PR fixes the issue #12237 relative to react-native-git-upgrade. When the user adds new files to the .gitignore file, those files are deleted during the upgrade process because it starts by creating a fresh .gitignore file without user's modification, so the user's ignored files are no longer ignored and they are deleted during the upgrading process. The best solution I've found to keep the user's ignored files... ignored, consists in appending the content of the .gitignore file in the `<TEMP DIR>/.git-rn/info/exclude` file. The user's ignored files are now ignored at the repository level, they no longer interfere with the upgrade process. Reminder: The tool uses a temporary local Git repository generated on the fly, so we can do whatever we want in it. - Publish react-native-git-upgrade to sinopia - `npm install -g react-native-git-upgrade` - Init a new project with an old version: `react-native init MyApp --version=0.50.0` - Create a new file named `dummy-ignored-file.json` in the project's root - Append `dummy-ignored-file.json` to the `.gitignore` file - Run `react-native-git-upgrade` 👉 The `dummy-ignored-file.json` is not deleted. [CLI][BUGFIX][react-native-git-upgrade] - Keep the user's ignored files while upgrading <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> Closes #17393 Differential Revision: D6839856 Pulled By: hramos fbshipit-source-id: e4e9d759b59790e3cbc52408cef8314bf0a9c772
Summary: This PR fixes the issue facebook#12237 relative to react-native-git-upgrade. When the user adds new files to the .gitignore file, those files are deleted during the upgrade process because it starts by creating a fresh .gitignore file without user's modification, so the user's ignored files are no longer ignored and they are deleted during the upgrading process. The best solution I've found to keep the user's ignored files... ignored, consists in appending the content of the .gitignore file in the `<TEMP DIR>/.git-rn/info/exclude` file. The user's ignored files are now ignored at the repository level, they no longer interfere with the upgrade process. Reminder: The tool uses a temporary local Git repository generated on the fly, so we can do whatever we want in it. - Publish react-native-git-upgrade to sinopia - `npm install -g react-native-git-upgrade` - Init a new project with an old version: `react-native init MyApp --version=0.50.0` - Create a new file named `dummy-ignored-file.json` in the project's root - Append `dummy-ignored-file.json` to the `.gitignore` file - Run `react-native-git-upgrade` 👉 The `dummy-ignored-file.json` is not deleted. [CLI][BUGFIX][react-native-git-upgrade] - Keep the user's ignored files while upgrading <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> Closes facebook#17393 Differential Revision: D6839856 Pulled By: hramos fbshipit-source-id: e4e9d759b59790e3cbc52408cef8314bf0a9c772
Looks like 7492860 resolved this. |
Description
I installed react-native-git-upgrade@0.2.5 and ran it on my project.
Reproduction
And in the end, no file is modified, and some files are missing, for example
android/app/google-services.json
(present in my.gitignore
)Solution
No idea
Additional Information
Note: my Android/iOS package name is
net.tribeez
(mypackage.json
name istribeez
)The text was updated successfully, but these errors were encountered: