git fetch documentation problem or bug

From: Angelo Borsotti <hidden>
Date: 2016-06-15 22:54:58

Hello,

git fetch <repository> <refspec> does not create the remote refs in
the current (local)
repository, as shown by the following script:

git init remote
git clone remote local

# populate the remote repository with a commit
cd remote
touch f1
git add f1
git commit -m A

cd ../local
git fetch origin master
git branch -avv

No ref is created.

However, if a git fetch origin is executed, the refs are properly created:

git fetch origin
 * [new branch]      master     -> origin/master
  remotes/origin/master 8a9186d A

I have not seen any clue in the documentation that tells the user
about this difference. The user may (naively) think that git fetch
origin downloads all branches, while git fetch origin <branch>
downloads only <branch>, but it is not so.
I am wandering if this is a documentation problem or a bug.

-Angelo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help