diff --git a/SourceGit/Git/Repository.cs b/SourceGit/Git/Repository.cs
index b52f0b40..cef88973 100644
--- a/SourceGit/Git/Repository.cs
+++ b/SourceGit/Git/Repository.cs
@@ -430,7 +430,14 @@ namespace SourceGit.Git {
///
///
public static Repository Clone(string url, string folder, string rName, string lName, Action onProgress) {
- var errs = RunCommand(folder, $"-c credential.helper=manager clone --progress --verbose --origin {rName} --recurse-submodules {url} {lName}", line => {
+ string RemoteName;
+ if (rName != null) {
+ RemoteName = $" --origin {rName}";
+ } else {
+ RemoteName = null;
+ }
+
+ var errs = RunCommand(folder, $"-c credential.helper=manager clone --progress --verbose {RemoteName} --recurse-submodules {url} {lName}", line => {
if (line != null) onProgress?.Invoke(line);
}, true);
diff --git a/SourceGit/UI/Clone.xaml.cs b/SourceGit/UI/Clone.xaml.cs
index ef82134b..957f828b 100644
--- a/SourceGit/UI/Clone.xaml.cs
+++ b/SourceGit/UI/Clone.xaml.cs
@@ -87,11 +87,7 @@ namespace SourceGit.UI {
string rName;
if (string.IsNullOrWhiteSpace(RemoteName))
{
- var from = RemoteUri.LastIndexOfAny(new char[] { '\\', '/' });
- if (from <= 0) return;
-
- var name = RemoteUri.Substring(from + 1);
- rName = name.Replace(".git", "");
+ rName = null;
}
else
{