Difference between revisions of "Git/branch"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Git
Jump to navigation Jump to search
m (proper sorting for categories)
(creating a branch)
Line 5: Line 5:
 
"Branching" is a concept basic to most [[version control system]]s.
 
"Branching" is a concept basic to most [[version control system]]s.
 
==Commands==
 
==Commands==
To find out what branches are available:
+
Information:
 
* <code>git branch</code> lists local branches
 
* <code>git branch</code> lists local branches
 
* <code>git branch -r</code> lists the remote branches
 
* <code>git branch -r</code> lists the remote branches
 
* <code>git branch -a</code> lists both local and remote branches
 
* <code>git branch -a</code> lists both local and remote branches
 +
Actions:
 +
* <code>git branch {{arg|name}}</code> creates a new 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:31, 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 branch lists local branches
  • git branch -r lists the remote branches
  • git branch -a lists both local and remote branches

Actions:

  • git branch <name> creates a new branch called "name"

Links

Reference