#How do i / can i reconcile squash merges with the original? (git)

17 messages · Page 1 of 1 (latest)

vocal quiver
#

Hey guys, i keep running into this issue with git and it is quite frustrating and im sure there must be a better way. My usualy workflow is this

Dev Branch:

A: add something
B: fix something

Squash merge A and B as C into master: Feat(added something)

So now master is nice and neat and dev is messy.

If i start editing dev again and push, then i get a merge conflict because dev isnt the same as master

What i have been doing so far is

git push origin dev

// then squash merge into master and delete dev on origin

git switch master

git pull origin master

git branch -D dev

git switch -c dev

git push origin dev

so then i can work on the next thing and merge that into master without conflicts. But this feels like not the best way to do.

im asking especially because i will release my app soon and i want a production branch ideally with neat squash commits but then it'd be a lot of resolving conflicts. Is there any better way / suggestions you guys might have?

Thank you in adnvance🙏

pure idol
#

You usally don't do squash commits on dev.

Why are you not using feature branches, merge them to dev and from their to master?

#

If you are interested in this workflow, I documented it already. Can pass you the markdown if you want.

pure idol
#

Another option is:
drop the permanent dev and use one feature branch per task, squash‑merge to master, then delete it

elder trench
vocal quiver
#

I mean yeah i treat dev as a feature branch where i squash merge into master then recreate dev from master if that what you mean🤔

pure idol
#

a feature branch is not the same as a dev branch

vocal quiver
#

ohhh i see

#

this is interesting

#

thank u wobby

#

But then i assume for the most part when pushing from dev to master, dev and master will end up looking the saem right?

#

after the push

#

and then dev gets new stuff later from feature branches, merges into master, then dev and master become the 'same' again

pure idol
#

yes exactly

#

i use this to deploy master on the main domain and dev to the staging domain