Gerrit - Create a Branch


Advertisements

You can create a branch on the local machine using the following command.

$ git checkout -b name_of_branch origin/master

The above command creates a new branch as shown in the following screenshot.

Gerrit Creating New Branch

Here, we have used branch123 as the new local branch. You can show the new branch from the 'master' using the following command.

$ git branch

The above command produces the result as shown in the following screenshot.

Gerrit Creating New Branch1

Git checkout navigates between the branch, updates the files in the working directory, and informs Git to record the commits on that branch.

Advertisements