I've been using git merge -squash master --strategy-option=theirs
on my release/staging branches. It allows me (as I understand) to take a snapshot of the current master branch into the release branch, but without all the hundreds of commits (each a new feature/bug fix) - instead they're all rolled up into a single commit ('Release 20180624' and 'Patch 1' etc) so I can quickly rewind to a nice set release point if I need to.
My issue is, after the git merge -squash master --strategy-option=theirs
command, it's not bringing in all the changes. I just ran the command, and the stage
branch, came up with an error compiling. I compare the two files, and on master
and stage
the file is different:
Master:
... loads of imports ...
import { CommentsModule } from '../comments/comments.module';
... loads more imports ...
import { routing } from './myjobs.router';
import { CommentsModule } from '../comments/comments.module';
@NgModule({
imports: [
...
It's a simple error, the CommentsModule
is imported twice.
Stage:
... loads of imports ...
import { CommentsModule } from '../comments/comments.module';
... loads more imports ...
import { routing } from './myjobs.router';
@NgModule({
imports: [
...
Why does this difference exist? Almost everything else is identical - but now I feel I can't really trust the process. I've noticed this a few times, usually a single change like this (assuming there's nothing I've missed) in a random file. This time it was caught early because it was a nice compile error - but I can imagine there are other changes that are harder to spot. My release and stage branches don't accurately reflect my codebase.
Am I using merge -squash
incorrectly?