git_cheat_sheet
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| git_cheat_sheet [2024/06/16 21:49] – [Install] stephen | git_cheat_sheet [2025/12/04 00:38] (current) – [Who needs to clean up] stephen | ||
|---|---|---|---|
| Line 59: | Line 59: | ||
| ci = commit -m | ci = commit -m | ||
| ca = commit --amend --no-edit | ca = commit --amend --no-edit | ||
| + | cu = reset HEAD~ | ||
| + | cuh = reset --hard HEAD~ | ||
| br = branch | br = branch | ||
| ba = branch -a | ba = branch -a | ||
| Line 147: | Line 149: | ||
| | ''< | | ''< | ||
| | ''< | | ''< | ||
| + | | ''< | ||
| | ''< | | ''< | ||
| Line 273: | Line 276: | ||
| ===== Who needs to clean up ===== | ===== Who needs to clean up ===== | ||
| - | Lists the author and date of the last commit on each remote branch. Need to run it on bash. | + | Lists the author and date of the last commit on each remote branch. |
| - | < | + | Bash: |
| + | < | ||
| for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format=" | for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format=" | ||
| </ | </ | ||
| + | Powershell: | ||
| + | <code powershell> | ||
| + | git branch -r | Where-Object { $_ -notmatch ' | ||
| + | $branch = $_.Trim() | ||
| + | $info = git show --format=" | ||
| + | [PSCustomObject]@{ | ||
| + | Info = $info | ||
| + | Branch = $branch | ||
| + | } | ||
| + | } | Sort-Object Info -Descending | Format-Table -AutoSize | ||
| + | </ | ||
| ===== How PRs work ===== | ===== How PRs work ===== | ||
git_cheat_sheet.1718574543.txt.gz · Last modified: 2024/06/17 09:49 (external edit)
