gitlab初始化代码

上传代码前新建好group及repository(需要有权限的账号操作)

进入要上传的文件夹中,先初始化本地分支,然后add远程分支,有冲突则要pull远程代码并合并,最后push本地分支到远程分支

PS D:\code\system-refactor\system-service> git add .
fatal: not a git repository (or any of the parent directories): .git
PS D:\code\system-refactor\system-service> git init
Initialized empty Git repository in D:/code/system-refactor/system-service/.git/
PS D:\code\system-refactor\system-service> git add .
warning: LF will be replaced by CRLF in gradle/wrapper/gradle-wrapper.properties.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gradlew.
The file will have its original line endings in your working directory
PS D:\code\system-refactor\system-service> git commit -m "初始化代码"
[master (root-commit) cba6c44] 初始化代码
 140 files changed, 6633 insertions(+)
 create mode 100644 .gradle/5.6.4/executionHistory/executionHistory.bin

。。。。。。。

PS D:\code\system-refactor\system-service> git remote add origin https://gitlab.liangmixian.me/system-refactor/system-service.git

PS D:\code\system-refactor\system-service> git pull origin master
From https://gitlab.liangmixian.me/system-refactor/system-service
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
fatal: refusing to merge unrelated histories
PS D:\code\system-refactor\system-service> git pull origin master --allow-unrelated-histories
From https://gitlab.liangmixian.me/system-refactor/system-service
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 README.md | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 README.md
PS D:\code\system-refactor\system-service> git push -u origin master

Enumerating objects: 208, done.
Counting objects: 100% (208/208), done.
Delta compression using up to 4 threads
Compressing objects: 100% (167/167), done.
Writing objects: 100% (207/207), 1.97 MiB | 2.99 MiB/s, done.
Total 207 (delta 17), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (17/17), done.
To https://gitlab.liangmixian.me/system-refactor/system-service.git
   ec5f959..9a5b797  master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值