From da6f0f8e667f0ee4678386124c9db2c11b4817c4 Mon Sep 17 00:00:00 2001 From: Dineshkumar Pandiyan Date: Sat, 16 Dec 2017 22:20:00 +0530 Subject: [PATCH] Branches - list branches (#171) --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 188ba28..bc8f0cb 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ For clarity's sake all examples in this document use a customized bash prompt in - [I want to discard only my unstaged local changes](#i-want-to-discard-only-my-unstaged-local-changes) - [I want to discard all of my untracked files](#i-want-to-discard-all-of-my-untracked-files) - [Branches](#branches) + - [I want to list all branches](#i-want-to-list-all-branches) - [Create a branch from a commit](#create-a-branch-from-a-commit) - [I pulled from/into the wrong branch](#i-pulled-frominto-the-wrong-branch) - [I want to discard local commits so my branch is the same as one on the server](#i-want-to-discard-local-commits-so-my-branch-is-the-same-as-one-on-the-server) @@ -418,6 +419,27 @@ $ git clean -f ``` ## Branches + +### I want to list all branches + +List local branches + +```sh +$ git branch +``` + +List remote branches + +```sh +$ git branch -r +``` + +List all branches (both local and remote) + +```sh +$ git branch -a +``` + ### Create a branch from a commit ```sh