1. you can branch locally, without affecting the remote directory - that's very cool
2. as we will see in later posts you can either merge or rebase your branch to the trunk (this defines the way your branch will get committed remotely: if you merge, you see the branch as a separate "path" in your remote repository, if you rebase, you can make sure your commit ends up looking like part of the trunk "path") - again very cool
So, here are the basics, use:
git branchto view all current branches, the star indicates which branch you are currently working in
git branch BRANCH_NAMEto create a new branch
git checkout BRANCH_NAMEto start working in that branch
git checkout masterto revert to the master (main) branch
git merge BRANCH_NAMEto merge BRANCH_NAME into another branch (for instance master)
git rebase BRANCH_NAMEto rebase BRANCH_NAME into another branch (for instance master)
git branch -d BRANCH_NAMEto delete a given branch
git branch -D BRANCH_NAMEto force delete a branch
git checkout BRANCH_NAME
to checkout a branch and start (or continue) working on it
More information about the difference between merge and commit coming soon.
Thoughts?
No comments:
Post a Comment