I've started two weeks ago using Git. For now I do only commit and push. I did a mistake and I've created a branch. Now I have a file, say "main.js" that has important changes in both branches.
In general : I have master that is production, then the dev branch, and a hot fix branch. I've changed main.js in dev, then I must change it in hot fix to solve a bug, and I merge hot fix in master. Now master and dev has disalligned main.js. How to maintain a situation like that?
Edit : Maybe im using git completly wrong ... I do some practical examples :
master - main.js - created 01/01/2017
function main() {
start();
}
dev - main.js - modified 07/01/2017
function main() {
new_stuff_1();
start(new_param);
new_stuff_2();
}
hotfix - main.js - modified 10/01/2017
function main() {
hotfix();
start();
}
After all merges i hope to have :
function main() {
hotfix();
new_stuff_1();
start(new_param);
new_stuff_2();
}