my react-native project was broken so I created a new folder and copyed all files to the new folder and reinstalled all packages. The project now works again and I would like to commit it to github.
But how do I commit these new changes without first pulling the old state and without overwriting the old commits?
I hope it's clear what I mean thank you for your time!
CodePudding user response:
Similar to what @joshmeranda suggested in the comments, this is what I would do:
- Delete old broken files
- Commit deleting them
- Copy new files to old project/folder
- Commit
- force-push your local changes to your remote
If you commit deleting old files and "creating" (copying) new files you should have a clean git history of what you did. After force pushing you should still be able to go back a few commits to your old changes.
Please do correct me if I'm wrong about this!