diff --git a/src/main/groovy/org/ajoberstar/gradle/git/tasks/GitClone.java b/src/main/groovy/org/ajoberstar/gradle/git/tasks/GitClone.java
index <HASH>..<HASH> 100644
--- a/src/main/groovy/org/ajoberstar/gradle/git/tasks/GitClone.java
+++ b/src/main/groovy/org/ajoberstar/gradle/git/tasks/GitClone.java
@@ -57,8 +57,9 @@ public class GitClone extends DefaultTask implements AuthenticationSupported {
 		cmd.setCredentialsProvider(getCredentialsProvider());
 		cmd.setURI(getUri().toString());
 		cmd.setRemote(getRemote());
+		cmd.setBare(getBare());
 		cmd.setNoCheckout(!getCheckout());
-		cmd.setBranch(getBranch());
+		cmd.setBranch("refs/heads/" + getBranch());
 		cmd.setBranchesToClone(getBranchesToClone());
 		cmd.setCloneAllBranches(getCloneAllBranches());
 		cmd.setDirectory(getDestinationDir());
Fixed branch specification for clone command.