Repository Branch
Create Branch
When cloud repository is created, master
branch will be initialised by default. We are able to create different branch with the following command
Once the branch had been created in your local workstation, Github Repository won't have any record on the branch. In order to create a new branch in the cloud repository, run the following command,
Merge Branch
After we had completed the development in a specific branch, we could merge two different branch.
Given a scenario, we want to merge feature/login
branch to develop
branch, and currently we are in feature/login
branch. Run the following code to change to develop
branch and merge the branch.
After merging the code, we will need to push the code to cloud repository with the following command
Remove Branch
After merging branch, we could remove the branch in local with the following command
feature/login
branch will be removed in local machine, but feature/login
still exist in cloud repository. Run the following command to remove the cloud branch
Now, we know how to create a new branch, merging branch and remove branch
Last updated
Was this helpful?