What is a Git branch?
Options
- A separate line of development, apart from
main(Correct option) - A copy of the project hosted on another website
- A type of commit message with a special format
- A file that was deleted from the working directory
Answer
A separate line of development where you can work without affecting the main line
Why
Commits can be organized into multiple lines of development called branches.
The usual way to work: create a branch for your feature (git switch -c feature/login), commit there, and when it is ready open a pull request to merge it into the main branch.
The main line is often called main. Branches are cheap in Git, so use them freely.
Remember
Branch = a safe parallel line of work.