将本地项目添加到gitLab上管理


1,先在gitLab 上创建一个新的项目,把开发人员加入项目

2,在本地项目初始化git 

  git init 

3,git add .

4,  git commit -m "XX"  添加本地项目到仓库

5,git push http://xxxxxx/xxxx/xxxx.git master

这时 确实把 本地项目 提交到了远程仓库的 master 分支上

 

 

6,想要创建一个分支 并提交到远程分支上

git branch -v  dev

git checkout dev

git push origin dev:dev 

报错:

'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

 

 是因为 此时 本地仓库和远程仓库还没有建立关联

git remote add origin http://xxxxxxxxx/xxxxxxx/xxx.git 

git remote add origin 远程仓库地址 

之后再 push 即可


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM