git branch merge code example
Example 1: git command to create a branch
git checkout -b [name_of_your_new_branch]
git push --set-upstream origin [name_of_your_new_branch]
Example 2: git new branch
$ git checkout -b [your_branch_name]
$ git branch [your_branch_name]
$ git checkout [your_branch_name]
Example 3: create new branch git from master
git checkout -b new-branch-name
Example 4: how to merge git branch to master
git checkout master
git pull origin master
git merge test
git push origin master
Example 5: merging branches in git
git checkout master
Switched to branch 'master'
git pull
To pull changes of team members to your master
git checkout develop
git merge master
Resolve Conflicts in develop
git checkout master
git merge develop
To merge your final changes along with other changes to your master
git pull
If there were any additional changes made meanwhile
git push
To push the final master to the master repository
git checkout develop
Example 6: git merge
git checkout master
git pull
git merge new-feature
git push