在IntelliJ IDEA中同步代码到华为云git仓库 (on windows)
来源:互联网 发布:林俊杰 hebe 知乎 编辑:程序博客网 时间:2024/06/07 08:33
在IntelliJ IDEA中同步代码到华为云代码仓库和同步到github中差不多,只是两个不同的代码托管平台,公司现在让把源码放到华为云上,捯饬了一会,捋一下步骤。
假如你在IDEA中创建了一个maven项目,叫ideaToHuaWeiCloud,并以这个项目所在目录创建一个git仓库:
结束之后Alt+F12在IDEA中找开终端,先把华为云上的git仓库pull下来,我在华为云上创建了一个测试用的仓库:git@codehub.devcloud.huaweicloud.com:19ce962b186c43b19d1d7786015239c1/testingDraft.git
git pull git@codehub.devcloud.huaweicloud.com:19ce962b186c43b19d1d7786015239c1/testingDraft.git --allow-unrelated-histories
注意后面加上--allow-unrelated-histories
,不然pull不下来,然后就可以看到README.md 就被pull 到项目中了,现在修改下README.md然后再push到华为云上,就出现了:
C:\Users\Administrator\IdeaProjects\ideaToHuaWeiClouds>git push origin masterfatal: 'origin' does not appear to be a git repositoryfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
出现了这个问题,怎么办呢,如果只是git push
看看有什么提示:
C:\Users\Administrator\IdeaProjects\ideaToHuaWeiClouds>git pushfatal: No configured push destination.Either specify the URL from the command-line or configure a remote repository using git remote add <name> <url>and then push using the remote name git push <name>
所以它给的提示很明确,把remote repo加上去:
C:\Users\Administrator\IdeaProjects\ideaToHuaWeiClouds>git remote add testing git@codehub.devcloud.huaweicloud.com:19ce962b186c43b19d1d7786015239c1/testingDraft.git
而后:
C:\Users\Administrator\IdeaProjects\ideaToHuaWeiClouds>git push testing masterCounting objects: 11, done.Delta compression using up to 4 threads.Compressing objects: 100% (10/10), done.Writing objects: 100% (11/11), 4.88 KiB | 1.63 MiB/s, done.Total 11 (delta 0), reused 0 (delta 0)To codehub.devcloud.huaweicloud.com:19ce962b186c43b19d1d7786015239c1/testingDraft.git 03dc590..9120f86 master -> master
就可以看到push成功了,README.md中的push to cloud
就是我后面加上去的:
ok了,基本的准备就都OK了,后面就可以专注撸代码了。
阅读全文
0 0
- 在IntelliJ IDEA中同步代码到华为云git仓库 (on windows)
- 在IntelliJ IDEA中同步代码到华为云git仓库 (on windows) 续 -- 配置好正确的SSH key
- Intellij IDEA中Git插件提交内容到远程仓库
- 【git】Intellij IDEA中Git插件提交内容到远程仓库
- 在 Intellij IDEA 提交代码到远程 Github 仓库的方法
- Intellij IDEA 提交代码到远程GitHub仓库
- Intellij IDEA 提交代码到远程GitHub仓库
- Intellij IDEA 提交代码到远程GitHub仓库
- Intellij IDEA 提交代码到远程GitHub仓库
- Intellij IDEA 提交代码到远程GitHub仓库
- IntelliJ IDEA 提交代码到远程GitHub仓库
- Intellij IDEA 提交代码到远程GitHub仓库
- 在IntelliJ IDEA中使用 GIT
- Git同步原始仓库到Fork仓库中
- intellij idea 查看git/svn/cvs仓库
- 如何在VSCode中同步代码到github (on Mac)
- IntelliJ IDEA 中把本地的工程保存到本地的 git 仓库的方法和把本地的工程发布到 github 的方法
- Windows下搭建基于SSH的Git服务并在IntelliJ IDEA中使用Git管理项目
- 机器学习sklearn19.0——决策树算法
- 1043. Is It a Binary Search Tree (25)-PAT甲级真题
- hbase遇到元数据缺失,hbase:namespace加载错误,hbase启动不了
- 6.闭包
- Python的文件锁使用
- 在IntelliJ IDEA中同步代码到华为云git仓库 (on windows)
- ssm框架中的配置文件
- 习近平致信祝贺2017年广州《财富》全球论坛开幕
- Vmware虚拟机下三种网络模式配置
- shadows name 'xxxx' from outer scope 警告解决
- 学习Linux C编程之操作系统基础训练
- angular2中引用kendoUI-combobox进行过滤
- zabbix3.0 之短信报警配置
- 深入理解JVM03--判断对象是否存活(引用计数算法、可达性分析算法,最终判定),Eclipse设置GC日志输出,引用