diff --git a/app/Livewire/Project/New/PublicGitRepository.php b/app/Livewire/Project/New/PublicGitRepository.php index 0578421b5..c6c699acf 100644 --- a/app/Livewire/Project/New/PublicGitRepository.php +++ b/app/Livewire/Project/New/PublicGitRepository.php @@ -97,10 +97,14 @@ public function load_branch() if ( (str($this->repository_url)->startsWith('https://') || str($this->repository_url)->startsWith('http://')) && - !str($this->repository_url)->endsWith('.git') + !str($this->repository_url)->endsWith('.git') && + !str($this->repository_url)->contains('github.com') ) { $this->repository_url = $this->repository_url . '.git'; } + if (str($this->repository_url)->contains('github.com')) { + $this->repository_url = str($this->repository_url)->before('.git')->value(); + } } catch (\Throwable $e) { return handleError($e, $this); }