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

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

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

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

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

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

如果报错:refusing to merge unrelated histories

扫描二维码关注公众号,回复: 3359379 查看本文章

则: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本地仓库,并提交到远程仓库

猜你喜欢

转载自www.cnblogs.com/jeryM/p/9706408.html