Problem: A sandbox key was to be used for testing out some API calls while hacking away at the problem. I later found out that the key wasn't properly "sandboxed" and thus shouldn't have it in my commit history anywhere. How can I reapply all commits but only change that one variable?
I'm okay dealing with merge conflicts and manually going through the 20+ commits to ensure that the previous variable is correctly overwritten and doesn't show up in the git commit history.
How can I go about doing something like this? Currently I'm the only one managing the repo/code and have full control over it. The way I see it I have these options:
- Simply copy all the files over and check in a "fat commit". There will only be a single commit with everything as it is at the "tip" of my branch. This gets me what I want, but I loose a lot of the history.
- Some trick with cherry picking? Not sure how?
- Some trick with rebase? Not sure how?
That variable shows up across a few commits so there are bound to be merge conflicts. How can I go about this?
Here's the current state of the branches:
master
: has the first two commitsmyBranch
: has the first two commits + additional twenty.
The 3rd commit in myBranch
introduced that variable. I need to change it there first and then repeat across other commits.