Skip to content

Commit

Permalink
update: git
Browse files Browse the repository at this point in the history
  • Loading branch information
zzdnb committed Dec 24, 2024
1 parent 9d65c1d commit 246b8b7
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions content/posts/git-guide/git指南.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,16 @@ git submodule update --remote --rebase

## 常用备忘内容

```bash
# 比较文件内容
git diff
git diff commitidxxx -- ./path1/path2/xxx.py
# 查看commit
git log --stat
git show commmitid
```

```bash
# 修改上次commit
git commit --amend -m ""
Expand Down Expand Up @@ -527,7 +537,6 @@ git stash pop
git stash list
git stash clear
# cherry-pick 合并特定commit 到main
git checkout main
git cherry-pick commitidxxxx
Expand All @@ -536,13 +545,44 @@ git add xxx
git cherry-pick --continue
# 取消合并
git cherry-pick --abort
```

```bash
# git rebase 处理复杂commit
git rebase -i commitid
git rebase --continue
git rebase --abort
git rebase --skip
```

# 比较文件内容
git diff
git diff commitidxxx -- ./path1/path2/xxx.py
```vim
pick 2a923b73 fix: conf
pick b5b06654 remove: entrypoint.sh
# 查看commit
git log --stat
git show commmitid
```
# Rebase 5aa07cc4..b5b06654 onto 5aa07cc4 (2 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
# commit's log message, unless -C is used, in which case
# keep only this commit's message; -c is same as -C but
# opens the editor
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified); use -c <commit> to reword the commit message
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
```

0 comments on commit 246b8b7

Please sign in to comment.