Skip to content

Commit

Permalink
add git cheatsheet.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jerksnapcrackle committed Sep 5, 2024
1 parent 7c74104 commit 7ae1ba7
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions archive/git_cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: "Git Cheatsheet"
layout: post
---

# Brief
This blog aims to memo some useful but not daily used commands.

# Reference
[progit](https://www.progit.cn/#_%E8%AE%B0%E5%BD%95%E6%AF%8F%E6%AC%A1%E6%9B%B4%E6%96%B0%E5%88%B0%E4%BB%93%E5%BA%93)

# Commands

## 1. Untract staged files
```bash
git rm -r --cached .
git add .
...
```

## 2. Rename a file

```bash
git mv file_from file_to
```

this command is basically equivalent to :

```bash
mv file_from file_to
git mv file_from
git add file_to
```





<script src="https://utteranc.es/client.js"
repo="jooooow/jooooow.github.io"
issue-term="pathname"
theme="github-light"
crossorigin="anonymous"
async>
</script>

0 comments on commit 7ae1ba7

Please sign in to comment.