gitlab新建一个仓库,然后和本地代码关联,并上传本地代码到仓库中

发布时间 2023-12-25 17:25:43作者: 苹果芒

1.创建一个gitlab项目的仓库:

 如果没有上传任何代码,这里Code tab会自动显示:从本地上传代码到仓库的操作命令:

git init
git add ./
git commit -m "first commit"
git branch -M master
git remote add origin https://oss.lalacorp.com/test-auttestapi/testforq.git
git push -u origin master

2.在本地项目中,进入项目根目录:

 然后在项目根目录中,执行上面的git命令。执行结果后,刷新gitlab页面,就发现代码已经上传到gitlab web端了: