This a collection of interesting links found in The Imposter's Handbook by Rob Conery.
Content:
This a collection of interesting links found in The Imposter's Handbook by Rob Conery.
Content:
To remove a submodule you need to:
| # alias to edit commit messages without using rebase interactive | |
| # example: git reword commithash message | |
| reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f" | |
| # git partial directory checkout alias | |
| pdir = "!f() { repo=\"$1\"; dir=\"$2\"; name=$(basename \"$repo\" .git); git clone --filter=blob:none --no-checkout \"$repo\" \"$name\" && cd \"$name\" && git sparse-checkout init --no-cone && git sparse-checkout set \"$dir\" && git checkout; }; f" | |
| # delete all repos in an org | |
| gh repo list YOUR_ORG_NAME --limit 4000 --json nameWithOwner --jq '.[].nameWithOwner' | xargs -I {} gh repo delete {} --yes |