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

相关推荐
一念一花一世界2 小时前
Arbess从基础到实践(25) - 集成GitLab+阿里云OSS实现Java项目自动化构建并将制品上传Aliyun OSS
java·阿里云·gitlab·cicd·arbess
一念一花一世界1 天前
Arbess从基础到实践(23) - 集成GitLab+Hadess实现Java项目构建并上传制品
java·gitlab·cicd·arbess·制品库
HIT_Weston2 天前
63、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(七)
前端·ubuntu·gitlab
HIT_Weston2 天前
65、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(九)
前端·ubuntu·gitlab
victory04312 天前
GitLab部署报告
gitlab
HIT_Weston2 天前
64、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(八)
前端·ubuntu·gitlab
HIT_Weston2 天前
62、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(六)
前端·ubuntu·gitlab
不爱吃米饭_3 天前
Gitea 轻量级的Git方案 - Gitlab的替代品
git·gitlab·gitea
嘻哈baby3 天前
自建GitLab与CI/CD实战:团队协作完整方案
ci/cd·gitlab
秦时明月天明3 天前
GitLab SSH Key 过期:git pull failed : remote your ssh key has expired
git·ssh·gitlab