This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| snippets:git [2019/06/26 09:16] – allspark | snippets:git [2022/06/28 10:32] (current) – allspark | ||
|---|---|---|---|
| Line 62: | Line 62: | ||
| ``` | ``` | ||
| git filter-branch --prune-empty --subdirectory-filter FOLDER-NAME | git filter-branch --prune-empty --subdirectory-filter FOLDER-NAME | ||
| + | ``` | ||
| + | |||
| + | ## show staged diff | ||
| + | |||
| + | ``` | ||
| + | git diff --cached | ||
| + | ``` | ||
| + | |||
| + | ## revert part of a commit | ||
| + | |||
| + | ``` | ||
| + | git revert -n $bad_commit | ||
| + | git reset HEAD . # Unstage the changes | ||
| + | git add --patch . # Add whatever changes you want | ||
| + | git commit | ||
| + | ``` | ||
| + | |||
| + | ## delete remote branch | ||
| + | |||
| + | ``` | ||
| + | git push origin --delete feature/ | ||
| ``` | ``` | ||