git - 无法克隆或推送现有项目到 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**
这会是什么问题。请帮帮我。谢谢
解决方案
下面的步骤解决了我的问题。在下面的命令中替换username
为您的 GitLab 用户名和project
您的 GitLab 项目名称。
git remote set-url origin https://username@gitlab.com/username/project.git
在您尝试使用以下命令推送到主服务器后,它将弹出一个窗口以将凭据添加到存储库。
git push -u origin master
推荐阅读
- ios - 已解决 - 如何在 SceneKit 中使用“带有 Alpha 通道的 HEVC”视频?
- r - 有没有办法为函数 st_linestring 设置精度?
- visual-studio-code - WSL 的 VS 代码服务器意外关闭
- java - 有没有更好的方法来实现我在多个类中使用的静态方法?
- node.js - 如何在不使用 await 的情况下返回对象
- bash - 我需要帮助使用 SED 替换第三组括号中的值
- python - 如何根据一年的首次出现来保留列表条目?
- django - WSGI 如何获取调用它的 URL?
- python - 第二个 tkinter 窗口不添加图像
- docker - 如何将 mpirun 与主节点和从节点一起使用,它们都是不同机器上的 Docker 容器?