设为首页 加入收藏

TOP

版本控制gitlab(四)
2023-07-23 13:34:02 】 浏览:110
Tags:gitlab
http://192.168.222.250': root Password for 'http://root@192.168.222.250': remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), 2.79 KiB | 2.79 MiB/s, done. [root@localhost ~]# ls anaconda-ks.cfg policycoreutils-python-2.5-34.el7.x86_64.rpm gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm xbz //可以查看到项目 [root@localhost ~]# cd xbz/ [root@localhost xbz]# ls README.md [root@localhost xbz]# git config --local user.email "136@78.com" //自定义一下邮箱 [root@localhost xbz]# git config --global user.name "root" //自定义一下用户名 [root@localhost xbz]# ls README.md [root@localhost xbz]# touch file1 //创建文件 [root@localhost xbz]# ls README.md file1 [root@localhost xbz]# git add file1 //将文件添加 [root@localhost xbz]# git commit //提交文件 Aborting commit due to empty commit message. [root@localhost xbz]# git commit -m "add file1" //提交 [main 757d06a] add file1 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 file1 [root@localhost xbz]# git push //进行上传 Username for 'http://192.168.222.250': root //如果没有设置免密登录,这里要输入用户名和密码 Password for 'http://root@192.168.222.250': Enumerating objects: 4, done. Counting objects: 100% (4/4), done. Delta compression using up to 4 threads Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 255 bytes | 255.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 To http://192.168.222.250/gitlab-instance-75e9fc3c/xbz.git fb8ebac..757d06a main -> main

查看是否上传

创建分支进行合并

[root@localhost xbz]# git branch dex
root@localhost xbz]# git push origin dex 
Username for 'http://192.168.222.250': root
Password for 'http://root@192.168.222.250': 
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: 
remote: To create a merge request for dex, visit:
remote:   http://192.168.222.250/gitlab-instance-75e9fc3c/xbz/-/merge_requests/new?merge_request%5Bsource_branch%5D=dex
remote: 
To http://192.168.222.250/gitlab-instance-75e9fc3c/xbz.git
 * [new branch]      dex -> dex

可以查看到分支创建成功

将文件上传到刚刚创建的分支里面

[root@localhost xbz]# git checkout dex  //通过命令切换分支
Switched to branch 'dex'
[root@localhost xbz]# touch files3  //创建文件
[root@localhost xbz]# git add files3  //添加文件
[root@localhost xbz]# git commit -m "add files3" //提交上传信息
[dex c9b8f17] add files3
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 files3
[root@localhost xbz]# git push   //第一次上传会有提示要有下面的命令上传 
fatal: The current branch dex has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin dex

[root@localhost xbz]# git push --set-upstream origin dex //将之前的分支合并了然后上传
Username for 'http://192.168.222.250': root
Password for 'http://root@192.168.222.250': 
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 254 bytes | 254.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0), pack-reused 0
remote: 
remote: To create a merge request for dex, visit:
remote:   http://192.168.222.250/gitlab-instance-75e9fc3c/xbz/-/merge_requests/new?merge_request%5Bsource_branch%5D=dex
remote: 
To http://192.168.222.250/gitlab-instanc
首页 上一页 1 2 3 4 5 下一页 尾页 4/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇脚本安装lamp 下一篇rsync

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目