I'm working on a big project that has two "main" git branches: master
and develop
. The first one (master
) is the production branch, the second one (develop
) is the staging branch.
The last days I worked on develop and today I have to do a deploy. Some colleagues told me the steps to do that:
git fecth
git checkout develop
git pull origin develop
git checkout -b release/1.2.0
git tag v1.2.0
git push origin release/1.2.0
git push --tags
create a merge PR from release/1.2.0 to master
create a release for the new version specifying `master` as branch target and the changelog
It's the first time I need to do a thing like that and I'm not sure I understand all.
I try to explain what I understand:
git fecth # fetch all the remote changes
git checkout develop # I move to develop branch
git pull origin develop # fetch and merge develop changes in master branch (?)
git checkout -b release/1.2.0 # create the new branch release/1.2.0 and move inside it
git tag v1.2.0 # attach a tag to that branch (or commit?)
git push origin release/1.2.0 # push to master the new branch
git push --tags # push to master all the tags
create a merge PR from release/1.2.0 to master
create a release for the new version specifying `master` as branch target and the changelog
I'm very confused. I think I didn't understand what git pull origin develop
does..