Skip to content

Commit

Permalink
feat(site/blog): add article of git commands
Browse files Browse the repository at this point in the history
  • Loading branch information
qhanw committed May 10, 2024
1 parent 6ae9956 commit fa81356
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
2 changes: 1 addition & 1 deletion site/blog/app/(web)/posts/[slug]/MDXContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const options: MDXRemoteProps["options"] = {
rehypeSlug,
rehypeAutolinkHeadings,
// @ts-ignore
[rehypeShiki, { theme: "nord" }],
[rehypeShiki, { theme: "vitesse-light" }],
],
},
};
Expand Down
6 changes: 2 additions & 4 deletions site/blog/app/(web)/posts/[slug]/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@
}
}

.prose pre.shiki.nord {
.prose pre.shiki.vitesse-light {
font-family: DM Mono, Input Mono, Fira Code, monospace;
font-size: 0.92em;
line-height: 1.4;
// margin: 0.5em 0;

code {
color: inherit;
}
background-color: #f9f9f9 !important;
}
43 changes: 43 additions & 0 deletions site/blog/md/posts/git-common-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: 常用GIT操作命令
date: 2024-05-10T20:08:56+08:00
category: git
tags: [git, bash]
description: 收集并整理日常工作中频繁用到的一些git操作命令。
---

- 合并分支
```bash
# 先切到需要合并到的分支
git checkout target-branch-name
git merge --no-ff feature/branch-name
```

- 查看提交记录
```bash
# 查看分支记录
git reflog

# 图形查看分支记录
git reflog --graph
```

- 同步远程分支
```bash
# 同步远程分支
git remote prune origin
```
- 获取远程分支
```bash
# 获取远程分支推送(-a 为全部推送)
git fetch -a

# 弃本地所有修改同步最新的远端代码
git fetch --all
git reset --hard origin/main #这里 main 为对应的分支名
git pull

# or
# git pull --force <远程主机名> <远程分支名>:<本地分支名>
git pull --force origin main:main
```

0 comments on commit fa81356

Please sign in to comment.