Create local branch from remote with the same name.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 28 Jan 2020 02:19:54 +0200
changeset 2409 6163ed9ff6de
parent 2408 c19423f2e7ee
child 2410 3a97cc7e1b39
Create local branch from remote with the same name.
git.rst
--- a/git.rst	Sun Jan 26 15:50:46 2020 +0200
+++ b/git.rst	Tue Jan 28 02:19:54 2020 +0200
@@ -174,13 +174,15 @@
 
   $ git branch -r
 
-List all remote branches (from all remotes)::
+List all remote branches directly from remote::
 
   $ git ls-remote
   $ git ls-remote origin
 
 List registered remotes::
 
+  $ git remote -v
+  $ git remote
   $ git remote show
 
 List remote branches from ``$REMOTE`` remote::
@@ -248,6 +250,14 @@
 
   $ git branch -f $NAME $HASH
 
+Create local branch from remote with the same name::
+
+  $ git checkout --track origin/fix
+
+Create local branch from remote with an alternative name::
+
+  $ git checkout -b myfix origin/fix
+
 git analog of 'hg incoming'
 ===========================