gitlab将本地项目提交到远程dev分支

获取Git路径

首先从远程获取到git路径,将给的git地址进行克隆到本地文件;

bash 复制代码
git clone http:************.git

按照git地址的文件路径将本地项目,拷贝到目标文件中

在该路径中,初始化命令;

bash 复制代码
# 初始化项目
git init
# 将项目提交到本地版本控制
git add .
# 将本地文件提交到本地临时存储
git commit -m '备注'

将本地项目与远程仓库建立关系

bash 复制代码
git remote add origin http://********.git

验证是否建立连接成功

bash 复制代码
git remote -v

再次拉取项目代码

bash 复制代码
git pull --rebase origin master

现在将本地项目提交到远程:

bash 复制代码
袅沫@LAPTOP-G2JOVNVG MINGW64 /g/statistis-services (master)
$ git push -u origin dev-1.0

提交异常:!!!!
error: src refspec dev-1.0 does not match any
error: failed to push some refs to 'http://10.137.214.77:8090/comprehensive/statistis-services.git'

解释:由于我们本地没有dev分支,但是我们现在将本地项目提交到远程,分支不匹配,所以报错,在本地可以看到当前是哪个分支 。

现在我们需要创建本地的dev分支与gitlab上的分支进行匹配

再次推本地项目

完结散花!!!

相关文件:将本地项目上传到gitlab

相关推荐
有理想的打工人1 天前
gitlab的参数设置与团队管理
gitlab
有理想的打工人1 天前
gitlab群组管理与ssh链接
ssh·gitlab
M-Ellen1 天前
从零搭建 Windows + WSL2 + Docker + GitLab CI/CD 完整手册
ci/cd·docker·gitlab
大脸胖柴2 天前
webStorm+gitLab操作学习
学习·gitlab·webstorm
jekc8683 天前
Ubuntu-GitLab
服务器·ubuntu·gitlab
在路上走着走着4 天前
openclaw v2026.4.5 版本 提示 pairing required 解决方案
gitlab
Gazer_S8 天前
【GitLab npm Registry 非标准端口安装问题解决方案】
前端·npm·gitlab
-KamMinG8 天前
Gitlab版本升级方案-13.x到17.x
gitlab
菜鸡000110 天前
把一个项目传到 GitLab 的某个群组
大数据·elasticsearch·gitlab
AlbertS11 天前
记一次推送lfs失败不能迁移git仓库到新的gitlab的问题
git·ai·gitlab·lfs·rejected