Assuming I have two branches one called stable
and another called dev
, and I have given commits in the dev
branch. How do I merge it to the stable
via command line ? thankful ;D
Asked
Active
Viewed 699 times
-1

JKostikiadis
- 2,847
- 2
- 22
- 34

Jorge Rabello
- 17
- 2
-
6Possible duplicate of [Merge development branch with master](https://stackoverflow.com/questions/14168677/merge-development-branch-with-master) – bruceskyaus Nov 13 '18 at 04:12
-
Hello and welcome to StackOverflow. Please take some time to read the help page, especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). And more importantly, please read [the Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922). You might also want to learn about [Minimal, Complete, and Verifiable Examples](http://stackoverflow.com/help/mcve). – Clijsters Nov 13 '18 at 09:11
-
Take a look at [git merge](https://git-scm.com/docs/git-merge) – Clijsters Nov 13 '18 at 09:12
1 Answers
3
This should work to merge dev into stable.
git checkout dev
git pull
git checkout stable
git pull
git merge dev
git push
Don't forget to commit & push your changes on dev first

Steven McConnon
- 2,650
- 2
- 16
- 21
-
Why do you `pull` two times? A simple `git merge` should do the trick and is much faster. – Clijsters Nov 13 '18 at 08:59
-
-
Just helping a typical use case. If there is a remote, then you'll need to pull to make sure the local branches are up to date. If there is no remote then git checkout stable git merge dev – Steven McConnon Nov 14 '18 at 10:01
-