新建Git仓库并关联远程Gitlab

1 自己在gitlab上建一个仓库后,后面会有一个命令使用demo,按照那个命令就可以了

直接clone项目

git clone git@new.gitlab.jiushiyaokuaile.cn:root/demo.git
cd demo
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master


如果是原有的项目关联 把项目的链接改成自己的就可以

cd existing_folder
git init
git remote add origin git@new.gitlab.jiushiyaokuaile.cn:root/demo.git
git add .
git commit
git push -u origin master

原文地址:https://www.cnblogs.com/QuestionsZhang/p/12843052.html