![]() Total 2 (delta 1), reused 0(delta 0), pack-reused 0īranch 'master' set up to track remote branch 'master' from 'origin'. To push all the changes to the remote master branch, we need to use git push -u origin master command as shown below. Step 8: Push the Changes to Remote Master Branch You can check all the local commits done using git log command as shown below. git tag 1.0.1 HEADĪfter tagging the last commit, you can verify it by using git tag -l command as shown below. The syntax for tagging the local commit is git tag HEAD. We can also tag the commit in case it is required by using git tag 1.0.1 HEAD command as shown below. git pull origin release-1.0.1Ģ Files changed, 4 insertions(+), 4 deletions(-) It should create a new commit in your local system. Now to pull and merge all the changes from release-1.0.1 branch, we need to use git pull origin release-1.0.1 command as shown below. Or -ff-only on the command line to override the configured default per You can replace "git config" with "git config -global" to set a default ![]() Git config pull.ff only # fast-forward only Git config pull.rebase false # merge (the default strategy) You can squelch this message by running one of the following Warning: Pulling without specifying how to reconcile divergent branches isĭiscouraged. git checkout -b masterīefore pulling and merging the files from release branch, check for any latest changes in master using git pull origin master command as shown below. Then to switch to a new branch master, you need to use git checkout -b master command as shown below. If you go to the cloned directory and check the current branch then it should show like below. Receiving objects: 100% (981/981), 1.01 MiB | 156.000 KiB/s, done.Īs our branching strategy allows to make a copy of develop branch only so by default our current residing branch will be develop. This will create a local directory called example-app containing all the cloned repo files. Here we will first clone the example-app repo from Bitbucket project using below git clone command. How to Merge Git Release Branch with both Master and DevelopĪlso Read: Solved: "error: src refspec master does not match any" when using git push Step 1: PrerequisitesĪ) You should have a running System(in my case it is Ubuntu 20.04 LTS) with git package installed.ī) You should have access to clone the Repo.Ĭ) You should have commit access to master and develop branch. So that both master and develop contain the same files. So once my release branch is ready to merge because the deployment can only happen from master as per our branching strategy so we need to first merge release-1.0.1 branch with master and then with develop. Along with that it also contains all the changes that we need to add in the next release. Here release-1.0.1 branch is created from develop. But since master is critical for production so all the release branches starts from develop. In other words, develop is the exact replica of master. Usually develop and master branch contains the same files. In my Lab setup, I have three branches in Bitbucket - release-1.0.1, develop and master. So it is utmost important to run all the steps accurately to avoid any unforeseen error. While the above steps looks quite simple but sometimes implementing this can be quite challenging in a real environment where you might encounter few issues. So the next time, when you are working on a hotfix or on a release or feature then you can start working by just creating a branch from develop. Once all the testing is completed and it is ready to be promoted in production then you need to first merge your release branch with master and then later with develop. If you are following a branching strategy in which you first start working on a release by creating a release branch from develop and then deploying your release branch in pre production environment post approval.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |