【GitHub & idea】简简单单弄好,不麻烦

5 篇文章 0 订阅

idea设置Git.exe

settings>version control>git
图片里设置git-cmd.exe错了,应该设的是git.exe
在这里插入图片描述

在idea上登录你的github

settings>version control>github>+
在这里插入图片描述

idea上传代码

VCS版本控制

在GitHub上新建储存库

在这里插入图片描述

弄完后,这时push可能会失败

在这里插入图片描述

我猜报错意思是HTTPS协议没有指定,传输不安全,那么进行下面的操作:

在这里插入图片描述

把刚刚新建的GitHub储存库链接填写上

在这里插入图片描述

commit

在这里插入图片描述
在这里插入图片描述

push成功

(这步成功了就行了,GitHub网页中就能看的上传的代码了)
在这里插入图片描述
下面是用git命令行上传代码

使用Git Bash

在这里插入图片描述
命令:
1、…or create a new repository on the command line
…或在命令行上创建新的存储库(常用这个

cd 你的工程目录路径
echo "# lvyouweb" >> README.md  //创建README.md文件,写的内容是 lvyouweb
git init //初始化
git add README.md  //添加README.md文件到github工程
git add . //添加本地工程的所有文件到github工程
git commit -m "first commit" //设置提交信息,会创建github工程的所有内容,相当于clone了本地工程
git remote add origin https://github.com/BIG-BOSS-ZC/lvyouweb.git //绑定https链接
git push -u origin master //上传整个工程

2、…or push an existing repository from the command line
…或从命令行推送现有存储库

git remote add origin https://github.com/BIG-BOSS-ZC/lvyouweb.git
git push -u origin master

实际操作演示

Administrator@XGA5P7RIFKTFCDR MINGW64 /e/HTML/Tomcat_pro1 (master)
$ echo "# lvyouweb" >> README.md

Administrator@XGA5P7RIFKTFCDR MINGW64 /e/HTML/Tomcat_pro1 (master)
$ git init
Reinitialized existing Git repository in E:/HTML/Tomcat_pro1/.git/

Administrator@XGA5P7RIFKTFCDR MINGW64 /e/HTML/Tomcat_pro1 (master)
$ git add README.md
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory.

Administrator@XGA5P7RIFKTFCDR MINGW64 /e/HTML/Tomcat_pro1 (master)
$ git add .
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in out/artifacts/Tomcat_pro1_war_exploded/WEB-INF/web.xml.
The file will have its original line endings in your working directory.
/...省略多行.../
warning: LF will be replaced by CRLF in web/js/npm.js.
The file will have its original line endings in your working directory.

Administrator@XGA5P7RIFKTFCDR MINGW64 /e/HTML/Tomcat_pro1 (master)
$ git commit -m "first commit"
[master b44af81] first commit
 3838 files changed, 36634 insertions(+)
 create mode 100644 .idea/artifacts/Tomcat_pro1_war.xml
 create mode 100644 .idea/encodings.xml
 create mode 100644 .idea/libraries/commons_collections_3_2_1.xml
 create mode 100644 .idea/libraries/jars.xml
 create mode 100644 .idea/libraries/lib.xml
 create mode 100644 .idea/misc.xml
 create mode 100644 .idea/modules.xml
 create mode 100644 .idea/uiDesigner.xml
 create mode 100644 .idea/workspace.xml
 create mode 100644 Tomcat_pro1.iml
 create mode 100644 out/artifacts/Tomcat_pro1_war_exploded/WEB-INF/classes/META-INF/Tomcat_pro1.kotlin_module
/...省略多行.../

Administrator@XGA5P7RIFKTFCDR MINGW64 /e/HTML/Tomcat_pro1 (master)
$ git push -u origin master
Counting objects: 1278, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1263/1263), done.
Writing objects:  35% (453/1278), 27.86 MiB | 155.00 KiB/s

在这里插入图片描述

在这里插入图片描述

回到idea发现,有了变化!

有Git的按钮,蓝色的是update project,绿色的是commit
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值