Git/branch: Difference between revisions
from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
creating a branch |
actions |
||
| Line 10: | Line 10: | ||
* <code>git branch -a</code> lists both local and remote branches | * <code>git branch -a</code> lists both local and remote branches | ||
Actions: | Actions: | ||
* <code>git branch {{arg|name}}</code> creates a new branch called "name" | * <code>git branch {{arg|name}}</code> creates a new branch called "name", pointing at the current {{l/same|HEAD}} revision | ||
* <code>git {{l/same|checkout}} {{arg|name}}</code> moves {{l/same|HEAD}} to point to the branch called "name" | |||
==Links== | ==Links== | ||
===Reference=== | ===Reference=== | ||
* [http://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell 3.1 Git Branching - Branches in a Nutshell] | * [http://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell 3.1 Git Branching - Branches in a Nutshell] | ||
Revision as of 18:41, 13 March 2015
A "branch" is a separate copy (of the files involved in a project) which can be worked on without affecting the original copy.
"Branching" is a concept basic to most version control systems.
Commands
Information:
git branchlists local branchesgit branch -rlists the remote branchesgit branch -alists both local and remote branches
Actions:
git branch Template:Argcreates a new branch called "name", pointing at the current Template:L/same revisiongit Template:L/same Template:Argmoves Template:L/same to point to the branch called "name"
