Managing branches.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 13 Feb 2017 22:46:07 +0200
changeset 2084 376824d203c2
parent 2083 75ae6a4ad500
child 2085 652aca73fc06
Managing branches.
git.rst
--- a/git.rst	Mon Feb 13 22:44:57 2017 +0200
+++ b/git.rst	Mon Feb 13 22:46:07 2017 +0200
@@ -129,6 +129,57 @@
 
   $ git commit -a -m "...."
 
+Managing branches
+=================
+
+Print current branch::
+
+  $ git branch
+
+List all known branches::
+
+  $ git branch -a
+
+List all known remote branches::
+
+  $ git branch -r
+
+List all remote branches (from all remotes)::
+
+  $ git ls-remote
+
+List remote branches from ``$REMOTE`` remote::
+
+  $ git ls-remote --heads $REMOTE
+  $ git remote show $REMOTE
+
+.. note::
+
+   Look to ``[remote "..."]`` in ``~/.git/config`` to find out names of possible
+   remotes. Alternatively get list from::
+
+     $ git remote show
+
+Getting branches pointers from default (``origin``) remote::
+
+  $ git fetch
+
+Getting branches pointers from ``$REMOTE`` remote::
+
+  $ git fetch $REMOTE
+
+.. note::
+
+   Only curtain branches fetched by default::
+
+     [remote "origin"]
+	 url = ...
+	 fetch = +refs/heads/*:refs/remotes/origin/*
+
+   Edit ``fetch`` value to change defaults.
+
+
+
 git analog of 'hg incoming'.
 ============================