Scud Scud - 1 year ago 130
Git Question

How to clone a specific Git branch?

Git clone will behave copying remote current working branch into local.

Is there any way to clone a specific branch by myself without switching branches on remote repository?

Answer Source
git init
git remote add -t refspec remotename host:/dir.git
git fetch

But IIRC, by default clone fetches all branches from remote, not current working branch.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download