Git branch: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 35: Line 35:


=Create a New Local Branch=
=Create a New Local Branch=
<font color=red>'''TODO''': https://home.feodorov.com:9443/wiki/Wiki.jsp?page=GitBranch</font>

Revision as of 21:31, 19 March 2018

Internal

Overview

git branch is used to perform branch-related operations: listing existing branches, creating new local and remote branches, renaming branches and deleting branches.

Use git checkout to check out the content of a branch in the local work area.

For a description of the concepts behind Git branches, see:

Git Concepts - Branches

List Existing Branches

The local (topic) branches in the repository are displayed by executing git branch without any argument, or with the default --list argument:

git branch [--list]

The output of the command reflects the content of the .git/refs/heads/ directory.

The tracking branches are displayed by executing:

git branch -r

The output of the command reflects the content of the .git/refs/remotes/<remote-name> directories.

To display both local and tracking branches, use:

git branch -a

Branch Details

git show-branch

Create a New Local Branch

TODO: https://home.feodorov.com:9443/wiki/Wiki.jsp?page=GitBranch