User Tools

Site Tools


snippets:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
snippets:git [2019/06/25 11:03] allsparksnippets:git [2022/06/28 10:32] (current) allspark
Line 1: Line 1:
 # git # git
 +
 +https://github.com/github/gitignore
  
 https://sethrobertson.github.io/GitFixUm/fixup.html https://sethrobertson.github.io/GitFixUm/fixup.html
Line 60: Line 62:
 ``` ```
 git filter-branch --prune-empty --subdirectory-filter FOLDER-NAME  BRANCH-NAME  git filter-branch --prune-empty --subdirectory-filter FOLDER-NAME  BRANCH-NAME 
 +```
 +
 +## show staged diff
 +
 +```
 +git diff --cached
 +```
 +
 +## revert part of a commit
 +
 +```
 +git revert -n $bad_commit    # Revert the commit, but don't commit the changes
 +git reset HEAD .             # Unstage the changes
 +git add --patch .            # Add whatever changes you want
 +git commit                   # Commit those changes
 +```
 +
 +## delete remote branch
 +
 +```
 +git push origin --delete feature/login
 ``` ```
snippets/git.1561453415.txt.gz · Last modified: by allspark