1

I've worked for about a year on a "dev" branch, now I need to push all the changes to "master", or more like clone dev into master as the structure of the project changed quite a bit and I don't want to resolve conflicts on each and every file.

I mostly use gui like GitHub desktop/source tree/gitkraken, and have no experience with the bash.

How can I achieve this? thanks

Xav Sc
  • 489
  • 1
  • 5
  • 23
  • Very naive solution would be checkout master at local and replace its contents with dev branch. Post that push your your changes into master. – G.G. Jan 22 '19 at 13:06
  • @RomainValeri I want to keep both master and dev, ideally keep working on dev and merge my changes into master once in a while, but I need to replace the actual too old content of master first – Xav Sc Jan 22 '19 at 13:12

1 Answers1

1

If you don't care about the history of master branch you can reset it to develop and force push.

git checkout master
git reset develop --hard
git push --force

If you want to keep the history, than it is a bit more complicated than that.

Igal S.
  • 13,146
  • 5
  • 30
  • 48
  • I don't expecially care about the history but I have no experience with the bash version … :/ – Xav Sc Jan 22 '19 at 13:13