首页 > 解决方案 > 无法克隆或推送现有项目到 gitlab

问题描述

我创建了一个私人仓库,我的笔记本电脑上有现有的项目。我需要将现有项目添加到我的仓库中。但是当我使用终端时,我收到以下错误:

remote: The project you were looking for could not be found.
fatal: repository 'https://gitlab.com/sathishchinniah/Taxi-App-User.git/' not found

我遵循的步骤:

**Existing folder
cd existing_folder
git init
git remote add origin https://gitlab.com/sathishchinniah/Taxi-App-User.git
git add .
git commit -m "Initial commit"
git push -u origin master**

这会是什么问题。请帮帮我。谢谢

标签: gitrepositorygitlab

解决方案


下面的步骤解决了我的问题。在下面的命令中替换username为您的 GitLab 用户名和project您的 GitLab 项目名称。

git remote set-url origin https://username@gitlab.com/username/project.git

在您尝试使用以下命令推送到主服务器后,它将弹出一个窗口以将凭据添加到存储库。

git push -u origin master

推荐阅读