Skip to content

Instantly share code, notes, and snippets.

@remram44
Created January 30, 2015 19:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save remram44/384451d56870715013cd to your computer and use it in GitHub Desktop.
git clone -n NAME is broken
remram@vebian:~$ git init a
Initialized empty Git repository in /home/remram/a/.git/
remram@vebian:~$ cd a
remram@vebian:~/a$ touch a
remram@vebian:~/a$ git add a && git commit -m a
[master (root-commit) 1a19233] a
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a
remram@vebian:~/a$ git tag -a 1.0 -m a
remram@vebian:~/a$ cd ..
remram@vebian:~$ git clone --single-branch -b 1.0 --no-checkout a b
Cloning into 'b'...
done.
remram@vebian:~$ cd b; git branch
* (no branch)
remram@vebian:~/b$ cd ..; rm -Rf b
remram@vebian:~$ git clone --single-branch -b master --no-checkout a b
Cloning into 'b'...
done.
remram@vebian:~$ cd b; git branch
* master
remram@vebian:~/b$ cd ..; rm -Rf b
remram@vebian:~$ git clone --single-branch -b 1a19233 --no-checkout a b
Cloning into 'b'...
warning: Could not find remote branch 1a19233 to clone.
fatal: Remote branch 1a19233 not found in upstream origin
fatal: The remote end hung up unexpectedly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment