Monday, 18 June 2018

GIT Bash Commands to Create New Branch and Merge

1. Clone the existing branch to new folder/branch on your machine.

2. Execute following bash commands

git branch new_branch_name

git checkout new_branch_name

add a new file to branch and execute the following command.

git add .

git commit -m "Creating new branch with additional changes"

git push origin new_branch_name

git branch -a

3.  Merge files from Master/Developer branch to new branch

git checkout new_branch_name

git merge origin/master(developer)

git commit -m "Merging changes from Master to new_branch_name"

git push origin new_branch_name

No comments:

Post a Comment