- A Git project can have more than one branch. These branches are a pointer to a snapshot of your changes.
- When you want to add a new feature or fix a bug, you spawn a new branch to summarize your changes.
- So, it is complex to merge the unstable code with the main code base and also facilitates you to clean up your future history before merging with the main branch.
1 | Creating new branch | git branch <branch-name> | Ex: git branch feature-1 |
2 | Creating new branch 2 | git branch <branch-name> | Ex: git branch feature-2 |
3 | Creating a new branch 3 | git branch <branch-name> | Ex: git branch feature-3 |
4 | To see list of branches | git branch | git branch |