So here’s what happened:
- I have a local repo for dev
- pushed to origin master
- from my test env I always do
git pullto update
Now of course I have different config files in the test env.
I locally changed my config file on test env.
In a hurried moment (…) I committed my local changes after a merge was conflicting.
Now the app runs fine, but git tells me
Your branch is ahead of ‘origin/master’ by 13 commits.
I understand, as I committed my local change – which I do NOT wish to push to master.
What would be the correct way to fix this? I want to:
- Have my local copy of the config file
- do not want to mess up with the basically correct config on the test env
- get rid of the ‘your branch is ahead’ message
- keep my master and my test env clean
Thanks!
You want to throw away your local commits on dev with
or
if you are on that branch already.
The best way to treat config transformations is with smudge/clean scripts. They are explained it the progit.org/book in the attributes chapter. You commit a config that will work nowhere. Rely on the scripts to transform the config to what it needs to be on each environment.