-1

I currently have a master branch and I branched out from it to code on a new dev branch

How to merge or rebase dev on master locally and then remotely, without losing commits or descriptions ?

  • 1
    Depending on what's in master, `git checkout master` - `git merge dev` - `git push` should suffice. If `git push` fails, it's because people have made changes to the master branch in the origin. You should look at [Pull Requests](https://yangsu.github.io/pull-request-tutorial/) instead though. – byxor Sep 05 '17 at 10:52
  • Possible duplicate of [Merge development branch with master](https://stackoverflow.com/questions/14168677/merge-development-branch-with-master) – Joe Sep 05 '17 at 11:11

1 Answers1

2

If there are no other changes on the master branch you can use a fast-forward merge:

git checkout master
git merge --ff dev
git push origin master

At that point, both master and dev would be referring to the same commit.

Derek
  • 4,575
  • 3
  • 22
  • 36