Git
Commands
Remove a file from the repo without deleting it:git rm --cached MYFILE.TXT
Remove a directory from the repo without deleting it:git rm --cached -r MYDIRECTORY
Search through git branches: git branch --all | grep -i MYSEARCH
Reset remote "busted_branch" with the contents of a "better_branch"
Make sure everything is pushed up to your remote repository, then checkout your busted_branch:
git checkout busted_branchOverwrite busted_branch with better_branch:
git reset --hard better_branchForce the push to your remote:
git push -f origin busted_branchResolve conflicted file with "their" changes:
git checkout --theirs path/to/fileResolve conflicted file with "our" changes:
git checkout --ours path/to/fileAliases to add to .gitconfig file
To prevent weird indenting, set paste mode in vim: :set paste
When done pasting: :set nopaste
GitHub CLI
Install on Mac: brew install gh
Auth: gh auth login
Check current PR check status: gh pr checks
Create PR: gh pr create
Check PR statuses: gh pr status
Merge PR: gh pr merge
Checkout PR: gh pr checkout PR_NUMBER_HERE
Edit PR: gh pr edit
Sources: https://dev.to/thomaslombart/how-to-save-time-with-github-cli-b9n
Last updated
Was this helpful?