idea 上传项目到gitlab(git)

一、在gitlab上新建项目

可以不创建README.md文件,省得推送项目时报错,

git 推送报错解决办法

二、idea推送项目到gitlab

1、idea的git配置

2、编辑gitignore文件,把排除的加上

3、VCS-创建Git仓库

4、选择项目

5、这样就有Git菜单了

6、Git-添加

7、提交

8、仍然提交

9、Git-推送

10、定义远程

11、把Git地址填上

12、推送

13、推送被拒

14、在控制台中显示详细信息

15、报错文本

16:04:07.007: [tlzf] git -c ... push --progress --porcelain origin refs/heads/master:refs/heads/master --set-upstream
error: failed to push some refs to 'http://10.10.10.10/cesp/tlzf.git'
hint: Updates were rejected because the remote contains work that you do
To http://10.10.10.10/cesp/tlzf.git
!    refs/heads/master:refs/heads/master    [rejected] (fetch first)
hint: not have locally. This is usually caused by another repository pushing
Done
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

16、git推送报错解决办法

git 推送报错解决办法

先拉一下,允许不相关的历史记录
git pull origin master --allow-unrelated-histories

可以直接在idea的终端里敲命令

idea的终端可以切换到Git Bash

17、再次推送

18、推送成功

三、参考

idea上传本地项目到gitlab

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要将代码上GitLab,您可以按照以下步骤进行操作: 1. 在弹出的Push Commits对话框中,点击“Define remote”,并填入您的GitLab仓库的git地址。 2. 确保您已经在本地完成了代码的编写和测试,并将其保存在您的IDE工作空间中。 3. 在IDE工具栏中选择“VCS”(版本控制系统)菜单,然后选择“Git”。 4. 在弹出的Git工具窗口中,选择要上的文件或文件夹,并右键单击选择“Git -> Add”将文件添加到Git的暂存区中。 5. 接着右键单击选择“Git -> Commit”进行提交,填写相关的提交信息,然后点击“Commit”按钮确认提交。 6. 最后,在IDE工具栏中选择“VCS”菜单,然后选择“Git”子菜单下的“Push”选项。 7. 在弹出的Push对话框中,选择要推送的分支,并点击“Push”按钮将代码推送到GitLab远程仓库。 这样,您的代码就会被上GitLab并与远程仓库同步了。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [idea提交项目gitlab](https://blog.csdn.net/congge_study/article/details/122800366)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [java版商城源码下载-yfshop:一丰商城(SpringBoot+SpringCloud分布式微服务架构解决方案项目)](https://download.csdn.net/download/weixin_38641876/19395169)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值