e-75e9fc3c/xbz.git
757d06a..c9b8f17 dex -> dex
Branch 'dex' set up to track remote branch 'dex' from 'origin'.
查看上传
再次创建文件进行上传
第二次上传就不用执行合并那个操作
[root@localhost xbz]# touch files4
[root@localhost xbz]# git add files4
[root@localhost xbz]# git commit -m "add files4"
[dex b6b67c6] add files4
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 files4
[root@localhost xbz]# git push
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), 223 bytes | 223.00 KiB/s, done.
Total 2 (delta 1), 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
c9b8f17..b6b67c6 dex -> dex
查看上传
对上传的文件进行拉取
将别的分支的文件拉取到你需要的那个分支里面
[root@localhost xbz]# git checkout main //切换到main分支
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
[root@localhost xbz]# git pull origin dex //将dex这个分支里面的文件都拉取到本地上面了
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:
git config pull.rebase false # merge (the default strategy)
git config pull.rebase true # rebase
git config pull.ff only # fast-forward only
You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.
Username for 'http://192.168.222.250': root
Password for 'http://root@192.168.222.250':
From http://192.168.222.250/gitlab-instance-75e9fc3c/xbz
* branch dex -> FETCH_HEAD
Updating 757d06a..b6b67c6
Fast-forward
files3 | 0
files4 | 0
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 files3
create mode 100644 files4
[root@localhost xbz]# git push //可以直接使用push上传
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
To http://192.168.222.250/gitlab-instance-75e9fc3c/xbz.git
757d06a..b6b67c6 main -> main
查看上传