git入门

1、下载安装

git官网下载安装,一直下一步。

2、链接github

**重点:**获取token
拿到token,在连接运程github用来进行身份认证的,十分简便
在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述在这里插入图片描述

3、idea集成

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

4、代码版本控制

新建一个文件夹:
git clone 远程仓库链接
.git里就已经有了远程仓库的信息。如地址,分支等不用再git init
git push
可直接上传代码到该仓库。
在这里插入图片描述
git status
查看文件的几个状态。

git add .
git add --all
将文件加入暂存区,文件就被跟踪了,文件状态发生改变。(这两个指令区别第二个添加的能被修改,没有测试过)

git commit -m "这里是这次将暂存区提交到本地仓库的说明"
暂存区文件被提交到本地的仓库里

git status查看文件状态,发现暂存区变空,无文件被标记

git push
将本地仓库提交到远程github仓库。

----------------------------------------------------------下面是github建立新仓库无代码状态的指引
Quick setup — if you’ve done this kind of thing before
or
https://github.com/crorylove/study.git
Get started by creating a new file or uploading an existing file. We recommend every repository include a README, LICENSE, and .gitignore.

…or create a new repository on the command line
echo “# study” >> README.md
git init
git add README.md
git commit -m “first commit”
git branch -M main
git remote add origin https://github.com/crorylove/study.git
git push -u origin main
…or push an existing repository from the command line
git remote add origin https://github.com/crorylove/study.git
git branch -M main
git push -u origin main
…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值