GitLab操作命令

DevOps GitLab评论1,295字数 567阅读1分53秒阅读模式

命令行指引

您还可以按照以下说明从计算机中上传现有文件。

Git 全局设置
git config --global user.name "Devops"
git config --global user.email "lucky@centoscn.vip"
创建一个新仓库
git clone git@gitlab.com:centoscn/openvpn.git
cd openvpn
git switch -c main
touch README.md
git add README.md
git commit -m "add README"
git push -u origin main
推送现有文件夹
cd existing_folder
git init --initial-branch=main
git remote add origin git@gitlab.com:centoscn/openvpn.git
git add .
git commit -m "Initial commit"
git push -u origin main
推送现有的 Git 仓库
cd existing_repo
git remote rename origin old-origin
git remote add origin git@gitlab.com:centoscn/openvpn.git
git push -u origin --all
git push -u origin --tags

 

GitLab最后更新:2022-11-6
DevOps
  • 本文由 发表于 2022年11月4日 14:12:39
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
Gitlab配置HTTPS GitLab

Gitlab配置HTTPS

简述 gitlab最新是开启https会自动配置,但只有三个月有效期,使用自己设的加密证书应设置。 配置 [root@iZ8vb3ycs3gfmlbmyxy6efZ ~]# vim /etc/g...
GitLab 中配置添加 SSH 密钥 GitLab

GitLab 中配置添加 SSH 密钥

1、GitLab配置添加SSH Key 本机已有公钥忽略,不需要生成,直接添加即可。 客户端配置生成SSH密钥对 ssh-keygen -t rsa -C "YOUR EMA...
修改Git远程仓库地址 GitLab

修改Git远程仓库地址

1、使用Git命令修改远程仓库 修改远程仓库 进入本地代码目录 devops@bogon ~ % cd demo 查看远程仓库地址 devops@bo...
评论  0  访客  0

发表评论