栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

git入门

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

git入门

git入门
  • 1、下载安装
  • 2、链接github
  • 3、idea集成
  • 4、代码版本控制

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.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/282743.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号