I know this topic has been approach a lot of times but I'm still having trouble to understand the right things I have to do so please excuse me for the repetition.
Here is the situation :
I'm launching a website in a few days so I want to be able to work on code without disturbing the online version. So I'm using git.
I made a repo called MySite on bitbucket.
This repo as two branch.
One master which is from where I push code to my server. This master branch has specific values for the .htaccess, sql access, minified JS etc...
One local which is where I have also specific .htaccess, sql to make it work from my localhost.
I'll focus on .htaccess to be more understandable. My local .htaccess is totally different to my master one.
Which means, I must NEVER merge Local to Master because if local .htaccess gets on prod it will down the server and if prod .htaccess gets on local, i won't be able to access to localhost.
I'll take an example. Let's say i want to work on myScript.js.
I checkout on the Local branch to access the unminified version.
I create a new branch my Script_mods then i checkout on this branch.
I work on myScript.js, i commit the file to branch Script_mods.
(At this step, should i push the Script_mods branch to Bitbucket or not )?
Then i checkout to branch Local and merge with Script_mods. This is to be able to keep tracks of commits and be able to delete Script_mods branch when I'm done with it.
At this point it's all good.
Then I want to also change the prod code so I checkout to Master and merge Script_mods.
Here comes the problem because I have some conflict with the .htaccess file. I don't understand why but i get two kinds of error.
Either the .htaccess is not push but then i get some unmerged errors. Either the .htaccess is modified and I need to rewrite it to get my server working again.
So long story short, I think I'm totally missing something on the workflow i should use but can't see which step...
I'd like to be able to create a branch with only specific files i want to work on then merge this branch to both Local and Master but I'm not sure that's even possible. So i get back to my misunderstanding of regular workflow.
Thanks for your clarifications...