mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-05 22:07:10 -04:00
WIP(translate): translate two category all tools
This commit is contained in:
parent
9db4b41daf
commit
4f550a9499
58 changed files with 708 additions and 172 deletions
77
src/tools/git-memo/git-memo.content.zh.md
Normal file
77
src/tools/git-memo/git-memo.content.zh.md
Normal file
|
@ -0,0 +1,77 @@
|
|||
## 配置
|
||||
|
||||
设置全局配置
|
||||
|
||||
```shell
|
||||
git config --global user.name "[姓名]"
|
||||
git config --global user.email "[邮箱]"
|
||||
```
|
||||
|
||||
## 入门
|
||||
|
||||
创建一个 git 仓库
|
||||
|
||||
```shell
|
||||
git init
|
||||
```
|
||||
|
||||
克隆现有的 git 仓库
|
||||
|
||||
```shell
|
||||
git clone [url]
|
||||
```
|
||||
|
||||
## 提交
|
||||
|
||||
提交所有已跟踪的更改
|
||||
|
||||
```shell
|
||||
git commit -am "[提交信息]"
|
||||
```
|
||||
|
||||
将新修改添加到上次提交中
|
||||
|
||||
```shell
|
||||
git commit --amend --no-edit
|
||||
```
|
||||
|
||||
## 我犯了一个错误
|
||||
|
||||
更改上次提交的消息
|
||||
|
||||
```shell
|
||||
git commit --amend
|
||||
```
|
||||
|
||||
撤消最近的提交并保留更改
|
||||
|
||||
```shell
|
||||
git reset HEAD~1
|
||||
```
|
||||
|
||||
撤消最近的 `N` 个提交并保留更改
|
||||
|
||||
```shell
|
||||
git reset HEAD~N
|
||||
```
|
||||
|
||||
撤消最近的提交并放弃更改
|
||||
|
||||
```shell
|
||||
git reset HEAD~1 --hard
|
||||
```
|
||||
|
||||
将分支重置为远程状态
|
||||
|
||||
```shell
|
||||
git fetch origin
|
||||
git reset --hard origin/[分支名]
|
||||
```
|
||||
|
||||
## 其他
|
||||
|
||||
将本地 master 分支重命名为 main
|
||||
|
||||
```shell
|
||||
git branch -m master main
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue