-1

I'm trying to keep 2 separated branches on git, the "Dev" on which I work and the "Master" which is basically a clean branch where I push clean versions of my project.

The problem here is that I don't want any history from previous commit when I merge. I, kind of, figured out how to do it and it worked juste fine for the first merge but now (on my second one) I'm having troubles with a lot merge conflicts.

Here is what I previously did :

git checkout dev

git tag -a 1.0 -m "version 1.0"

git push origin --tags

git checkout master

git merge --squash 1.0

git commit "message"

git push origin master

So it worked the first time when the master branch was totally clean but now, I get a lot a merge conflicts. Is there a way to force merge every changes there is on the tag 1.0 to master ? Or a better way to do all of this ?

Community
  • 1
  • 1
Robray
  • 1
  • Possible duplicate of [Git: Merge to master while automatically choosing to overwrite master files with branch](http://stackoverflow.com/questions/1295171/git-merge-to-master-while-automatically-choosing-to-overwrite-master-files-with) – scrowler Dec 11 '16 at 21:34
  • @Robray, did the answer help you to solve the problem? If yes, please mark it (on the left of answer). And it can help more people with similar questions. – Marina Liu Dec 21 '16 at 08:39

1 Answers1

0

Yes, you can try one of the commands below to solve the merge conflicts automatically:

git merge -X theirs --squash 1.0
git merge -X ours --squash 1.0

And then use git commit -m 'message'.

Marina Liu
  • 36,876
  • 5
  • 61
  • 74