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

相关推荐
_运维那些事儿15 小时前
GitLabCI/CD语法
linux·服务器·git·ci/cd·gitlab·运维开发·devops
_运维那些事儿15 小时前
GitLab&Jenkins
运维·ci/cd·gitlab·jenkins·devops
Jeacean2 天前
gitlab 仓库所有分支开启分支保护脚本
gitlab
nhfc992 天前
Gitlab备份且提交Windows服务器数据
服务器·windows·gitlab
Knight_AL2 天前
Jenkins 配置 GitLab 认证并实现自动化部署
自动化·gitlab·jenkins
危笑ioi3 天前
docker部署jenkins/gitlab/nexus3/nginx配置端口转发与ssl
nginx·docker·gitlab·jenkins·ssl
木易 士心5 天前
GitLab 安装指南
git·gitlab
Linux运维技术栈5 天前
GitLab社区版备份优化:3M包为何是独立完整备份?
运维·git·gitlab
z.q.xiao6 天前
【镜像模式】WSL如何访问windows内网服务
linux·网络·windows·gitlab·wsl·dns
github.com/starRTC6 天前
Claude Code中英文系列教程17:将Claude Code集成在GitLab工作流里面
git·gitlab·github