Codrguy
Codrguy

Reputation: 669

Git command equivalent

is

git clone -b branch1 ssh://gitolite@host/project/testkit

equivalent to

git clone ssh://gitolite@host/project/testkit
cd testkit
git checkout branch1

?

Upvotes: 1

Views: 43

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 992767

Yes, this is supported by the git clone documentation:

-b <name>

Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out.

Upvotes: 1

Related Questions