将本地项目上传到GitLab:
git init
git add .
git remote add origin git@gitlab.xxxx.com:loangroup/xxxx.git
报错:fatal: remote origin already exists. 删除远程已经存在的origin:
git remote rm origin
然后继续:
git remote add origin git@gitlab.xxxx.com:loangroup/xxxx.git
将代码push:
git push
又报错,不过有提示信息:
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
按照提示信息输入命令:
git branch --set-upstream-to master origin/master
报错:fatal: branch ‘origin/master’ does not exist
先提交本地代码到本地仓库:
git c