1.

Git Branch

Answer»

  • A branch in Git is used to keep your changes until they are ready.

  • You can do your work on a branch while the main branch(main) remains stable. After you are done with your work, you can merge it to the main branch.

For creating a new branch, the following command is used :

git branch <branch_name>

For example -

git branch demo

This command creates a new branch named demo from the Main branch:


  • The diagram shows there is the main branch.

  • There are two more branches small feature and large feature working separately.

  • Once the work is complete for the two separate branches, you can merge it into the main branch.




Discussion

No Comment Found