I am a member of a Github repository where there are three branches, master
, dev
and deployment
.
I cloned the repository on my local computer with:
git clone git@github.com:COMPANY/repo.git
What I need to do is to merge the changes that were pushed in the dev branch
into the master branch
, and then the master branch
into the deployment branch
. My issue is that I only see the master branch
on my local clone.
The way I tried to do what is required is as follows:
I created a
dev branch
and adeployment branch
on my local repository with:git checkout -b dev
andgit checkout -b deployment
.I pulled the
dev branch
anddeployment branch
from the origin with:git pull origin dev
andgit pull origin deployment
.I switched to the
master branch(git checkout master)
and I merged thedev branch
into it:git merge dev
.Then I switched to the
deployment branch(git checkout deployment)
and I merged themaster branch
into it:git merge master
.
Is this the right procedure to do it or is there a better way?
How can I push all the changes from the two merged branches back to the origin on Github?