How would you accomplish this?
mkdir newbuild
cd newbuild
git init
git remote add origin git+ssh://user@host:22/var/www/vhosts/build
$ git checkout -b origin/mybranch
fatal: You are on a branch yet to be born
How would you accomplish this?
mkdir newbuild
cd newbuild
git init
git remote add origin git+ssh://user@host:22/var/www/vhosts/build
$ git checkout -b origin/mybranch
fatal: You are on a branch yet to be born
What are you trying to do here? You don't have an origin remote, so you don't have any remote branches, so you can't create a local branch based off of one. You need to either clone the remote repository, or add it as your origin remote and then git fetch
.
Of course, the error message is completely wrong. Ignore it.
I assume that origin
's active/default branch isn't mybranch
which is why a plain clone won't work. It might also be easier to just do this:
git clone -n git+ssh://user@host:22/var/www/vhosts/build newbuild
cd newbuild
git checkout -b origin/mybranch