王海鱼 发表于 2024-8-15 18:41:15

idea 上传项目到gitlab(git)

一、在gitlab上新建项目

可以不创建README.md文件,省得推送项目时报错,
git 推送报错解决办法
https://img-blog.csdnimg.cn/direct/e43f8c3396164ebaba3900698e68d798.png
二、idea推送项目到gitlab

1、idea的git设置

https://img-blog.csdnimg.cn/direct/a7dbfc6bd34a451987c809991c548247.png
2、编辑gitignore文件,把排除的加上

https://img-blog.csdnimg.cn/direct/e8b4e2495bdb4619ad8702908fd3b111.png
3、VCS-创建Git堆栈

https://img-blog.csdnimg.cn/direct/f8cef3262e8d4fb7a14789e8b6dc372f.png
4、选择项目

https://img-blog.csdnimg.cn/direct/e5a03c1712754dd885440b346e43fb32.png
5、这样就有Git菜单了

https://img-blog.csdnimg.cn/direct/72e7b0a5c0dc41b68d928fcf564eebd2.png
6、Git-添加

https://img-blog.csdnimg.cn/direct/58b6461662b1481697b5e4bd79a537eb.png
7、提交

https://img-blog.csdnimg.cn/direct/054400eecba541c0aa2df834f5ad3e78.png
8、仍然提交

https://img-blog.csdnimg.cn/direct/7d9070b5155947a4a0f94defb7642707.png
9、Git-推送

https://img-blog.csdnimg.cn/direct/0ec3fe95730f42cab9b4bf8314457b65.png
10、界说远程

https://img-blog.csdnimg.cn/direct/d25237910a51469e9b688127d074cfd6.png
11、把Git地点填上

https://img-blog.csdnimg.cn/direct/0be7082f49fb47d99afa4e07a053eeef.png
12、推送

https://img-blog.csdnimg.cn/direct/8ef7b4aeffcd4c24bc7f2278a833c14c.png
13、推送被拒

https://img-blog.csdnimg.cn/direct/3aafac841d1e49328eb24cfe0a53275b.png
14、在控制台中显示具体信息

https://img-blog.csdnimg.cn/direct/0d96a9fdcdc9489da76bb24fbbfb70ef.png
15、报错文本

16:04:07.007: 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    (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的终端里敲下令
https://img-blog.csdnimg.cn/direct/ac1ff6450dc147a18a97f5556248cb42.png
idea的终端可以切换到Git Bash
https://img-blog.csdnimg.cn/direct/8a0cba4f793d421d8d67310310692fe4.png
17、再次推送

https://img-blog.csdnimg.cn/direct/fcfda35a2fb745c883f605d49861f33a.png
18、推送乐成

https://img-blog.csdnimg.cn/direct/93ba12f0a8ec4ce898fb553c616ac9f9.png
三、idea项目关闭版本控制,断开git连接

idea项目关闭版本控制,断开git连接
 
四、参考

idea上传本地项目到gitlab


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: idea 上传项目到gitlab(git)