在本地項(xiàng)目右擊
git init
git add .
git commit -m "注釋"
git remote add origin 地址
# 修改分支master為main
git branch -m master main
# 這個(gè)關(guān)鍵,因?yàn)橹霸趃itlab創(chuàng)建倉庫有默認(rèn)文件
git pull origin main --allow-unrelated-histories
# git push origin main
?最后一步報(bào)錯:
GitLab: You are not allowed to push code to protected branches on this project.
去gitlab修改上傳代碼的賬戶權(quán)限developer權(quán)限為下圖
原因是:
英文
?中文
?可以修改開發(fā)者可以推送文章來源:http://www.zghlxwxcb.cn/news/detail-408139.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-408139.html
到了這里,關(guān)于【gitlab】上傳本地代碼到gitlab的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!