Skip to content

Commit

Permalink
修改post文件名,新增git笔记
Browse files Browse the repository at this point in the history
  • Loading branch information
yinhao-f committed Dec 9, 2021
1 parent ce4696c commit a079da7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
3 changes: 1 addition & 2 deletions source/_posts/2021/11/10-mysql-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ date: 2021-11-10 15:01:38
tags: MySQL
featured: true
---
# 前言
实用MySQL语句小抄,持续更新
# MySQL笔记
SQL,全称Structured Query Language,读作"sequel"或"S-Q-L"

# 命令行语句
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: MyBatis 笔记
title: MyBatis Cheatsheet
date: 2021-12-01 16:21:18
tags: [MySQL, MyBatis, Java]
featured: true
Expand Down
64 changes: 64 additions & 0 deletions source/_posts/2021/12/09-git-cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Git Cheatsheet
date: 2021-12-09 16:02:51
tags: git
---

# Getting Started
## 配置文件
```shell
git config --global user.name "your_name"
git config --global user.email "[email protected]"
```

不同层级的配置文件

`--global` 全局配置文件
`--system` 系统配置文件
`--local` 仓库配置文件
`--worktree` worktree配置文件

## 初始化仓库
首先cd到仓库目录内,然后在命令行输入
```shell
git init
```

## 本地推到远程
```shell
git remote add origin [url]
```

# 基本操作
## 查看仓库状态
```shell
git status
```

## 查看变更
```shell
git diff [file_name]
```

## 提交修改
```shell
git add .
git commit -m "commit message"
```

## 查看提交历史
```shell
git log
```
单行显示提交备注:`--pretty=oneline`

## 查看命令历史
```shell
git reflog
```

### 版本回退
```shell
git reset --hard [commit_id]
```
`commit_id`可以写成`HEAD^`代表上一次提交,`HEAD^^`代表上上次,`HEAD~100`代表上100次

0 comments on commit a079da7

Please sign in to comment.