码迷,mamicode.com
首页 > 其他好文 > 详细

idea为本地项目创建仓库并git到云上

时间:2018-09-26 13:54:33      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:net   log   存储   初始   article   origin   验证   tor   code   

1、为本地项目创建一个本地仓库:

技术分享图片

2、在码云上创建一个仓库,(初始化的时候先不要创建README.md文件)

3、本地仓库关联远程仓库:右键项目选址git>>repository>>remotes

技术分享图片

点+号输入远程仓库的地址

技术分享图片

 

4、add、commit、pull、push将本地项目存储到远程仓库

 

如果报错:refusing to merge unrelated histories

则:git pull origin master --allow-unrelated-histories

 如果>>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 push -u origin master  (说是如果没有分支会创建分支,未验证)

技术分享图片

idea创建git项目到远程仓库:https://jingyan.baidu.com/article/0a52e3f4ef625bbf62ed7286.html

IDEA中如何初始化git本地仓库,并提交到远程仓库

 

idea为本地项目创建仓库并git到云上

标签:net   log   存储   初始   article   origin   验证   tor   code   

原文地址:https://www.cnblogs.com/jeryM/p/9706408.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!