I was working on a project and after every commit, I had to make the server up locally and test the changes.
There were few config changes in order to make the server up locally. Hence, I made the config changes first and introduced it as a new commit.
Then, I made the actual project changes. Here's the list of commits I have introduced. (Let's say)
git commit -am "config changes to make the server up in LOCAL"
git commit -am "added prod changes 1"
git commit -am "added prod changes 2"
git commit -am "added prod changes 3"
Now, If I have to push these changes to prod, I am in big trouble. I do not want the LOCAL commits to be present. This again adds some work while code reviews or when merging with the master branch. (Undoing config changes)
These local config changes are quite common for testing purposes and I have to make these changes for every change if it requires running the server locally.
Is there any way I can use git
functionality in order to reduce this repetitive task?
My thought is to use git stash
to save the config changes and apply those while testing.
Any better ways would be greatly helpful. Thanks in advance!
Note: I am not asking how to delete
or undo
that commit.