Jump to content

Super bash by @Rongzhou

From Wikibase
Line 24: Line 24:
First set `$pr` to the PR number.
First set `$pr` to the PR number.
</blockquote>
</blockquote>
== File ops ==
Enumerate non <code>.gitignore</code>d files:
<syntaxhighlight lang="bash" copy>
git ls-files -z '*.md' | xargs -0
</syntaxhighlight>

Revision as of 08:58, 14 October 2026

Remote:

git remote -v
git remote -h # for more options

Github CLI (gh)

Set remote:

gh repo set-default {target}

Merge pr and delete local git worktree + remote branches

b=$(gh pr view $pr --json headRefName -q .headRefName); w=$(git worktree list --porcelain | awk -v r="refs/heads/$b" '/^worktree /{p=substr($0,10)} /^branch / && $2==r {print p}'); [ -n "$w" ] && git worktree remove "$w"; gh pr merge $pr --merge --delete-branch

First set `$pr` to the PR number.

File ops

Enumerate non .gitignored files:

git ls-files -z '*.md' | xargs -0