You can create a branch using:
git checkout <branch_name>This will create a branch from current working branch. You can check your current working branch by running:
git branchIf you have multiple branches your current branch is the one which is marked with * at the beginning.
If you want to create a branch from some other existing branch then you can do:
git checkout -b <branch_name> <from_branch_name>This will create a new branch from the given branch.
The advantage of creating branch is you can work on your changes without affecting other people who are also making changes.
Once you are done with your work then you can merge it back to the main branch. The main branch in git is referrred to as master.
No comments:
Post a Comment