git-sync icon indicating copy to clipboard operation
git-sync copied to clipboard

[Feature Request] Purge branches/tags in destination repository

Open Frederick888 opened this issue 5 years ago • 3 comments

For example, a user may want to push to GitLab simply to trigger a around of testing in GitLab CI, in which case it'd be nice if it's possible to clean up remote branches/tags as well so that users don't need to do this manually.

Frederick888 avatar Dec 07 '20 07:12 Frederick888

I believe you're asking for one-off user triggered branch deletion? I don't think that's a use-case git-sync will support at this time. You can look into actions/checkout which lets you checkout gitlab repo and run git commands to delete branches.

wei avatar Dec 07 '20 17:12 wei

@wei Sorry I may not have put this clearly.

For example, in the source repo I've got master and feature branches. After merging feature into master, I often delete the feature branch in both local and source repos. But after pushing it to source repo, git-sync doesn't delete the feature branch in destination repo. Over the time I get more and more stale branches in the destination repo.

So I wonder if it's possible to trigger git-sync on delete as well and purge those branches/tags? Of course I can do this using actions/checkout and Git commands but imho this feature sounds like a good complement to this project.

Frederick888 avatar Dec 07 '20 22:12 Frederick888

Ahh, I see. Thanks for explaining that!!

I agree adding an option to force sync all refs while deleting all the missing refs would be a good feature to have (to keep repos in both places clean). Reopened and PR welcome!!

wei avatar Dec 07 '20 22:12 wei