#第一次git需要的操作
git config --global user.email "532733691@qq.com"
git config --global user.name "wangchao"
#保存git账号信息到本地
git config --global credential.helper cache
#将pull时,代码与本地合并
git config --global pull.rebase false
#修改远程仓库地址,上传源码到新仓库时使用,
git remote set-url origin http://git.ope.ai:8999/ex/easy-exchange-parent.git
#提交代码有问题时使用,先删除旧的提交记录,然后增加远程仓库地址
rm -rf .git
git remote add origin http://git.ope.ai:8999/ex/easy-exchange-parent.git
#允许 Git 合并两个不相关的项目历史
git pull origin main --allow-unrelated-histories
#提交代码操作命令
git add .
git commit -m 'init'
git push origin main
####将已有代码上传到新空白gitlab仓库
新仓库名:http://git.ope.ai:8999/ex/easy-root.git
#修改远程仓库链接
git remote set-url origin http://git.ope.ai:8999/ex/easy-root.git
#添加远程仓库链接
git remote add origin http://git.ope.ai:8999/ex/easy-root.git
#强制推送代码到对应的分支,你处于test就推到test分支。推所有就是git push -u --all origin
git push -u origin test