MarkOates / blast

0 stars 0 forks source link

Add remote branch tracking to `status` #32

Open MarkOates opened 1 year ago

MarkOates commented 1 year ago

Problem

The status program will check local repos and their status, if they're up-to-date, if there are some scattered files in the worktree, if there are any branches that might have code I'm working on, etc.

To keep the entire git universe clean, It would be nice if status could also check the existence of branches on origin.

Solution (Partial)

Remote branches can be detected with

git branch -r

Note that any branches that have been deleted on remote will still remain on your system. You can "prune" them with:

git remote prune origin

If you want to just see which branches will be pruned, you can add the --dry-run flag:

git remote prune origin --dry-run