Skip to content

Add --delete-deleted option to delete branches which have been deleted from the remote #41

@johnddx

Description

@johnddx

Whenever this error occurs running git-up:

hotfix-write-process-output-to-console error: remote branch doesn't exist

There is an opportunity to clean up the local branches to reflect similar clean-up performed on the remote. --delete-deleted as an option name seems somewhat reflective of the intent. -d is probably suitable for short.

If -d is specified, a local branch should be deleted if all of the following are true:

  • The branch has an uplink configured
  • There is no remote branch of the same name and/or matching the uplink
  • The branch is contained in another branch
    If any of the above are false, the deletion should not occur.

Note: This is a heuristic. It is possible to assign an uplink to a branch without ever actually using it. This would mean the remote branch wasn't actually deleted, it was never created to begin with. However, as long as the branch is contained in another branch, it should still be safe to delete the local reference.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions