Gitlab python-based job to remove stale branches

Problem

GitLab has a concept of stale branches, where they defined all the branches updated more than 3 months ago as stale.

However, it’s not possible to do a bulk removal or have a more sophisticated control of these branches.

Here is a …


This content originally appeared on DEV Community and was authored by Artem Ptushkin

Problem

GitLab has a concept of stale branches, where they defined all the branches updated more than 3 months ago as stale.

However, it's not possible to do a bulk removal or have a more sophisticated control of these branches.

Here is a full example of how you can set this up. As for scheduled tasks you can use Gitlab scheduled jobs.

Code


This content originally appeared on DEV Community and was authored by Artem Ptushkin


Print Share Comment Cite Upload Translate Updates
APA

Artem Ptushkin | Sciencx (2024-07-15T07:54:22+00:00) Gitlab python-based job to remove stale branches. Retrieved from https://www.scien.cx/2024/07/15/gitlab-python-based-job-to-remove-stale-branches/

MLA
" » Gitlab python-based job to remove stale branches." Artem Ptushkin | Sciencx - Monday July 15, 2024, https://www.scien.cx/2024/07/15/gitlab-python-based-job-to-remove-stale-branches/
HARVARD
Artem Ptushkin | Sciencx Monday July 15, 2024 » Gitlab python-based job to remove stale branches., viewed ,<https://www.scien.cx/2024/07/15/gitlab-python-based-job-to-remove-stale-branches/>
VANCOUVER
Artem Ptushkin | Sciencx - » Gitlab python-based job to remove stale branches. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/15/gitlab-python-based-job-to-remove-stale-branches/
CHICAGO
" » Gitlab python-based job to remove stale branches." Artem Ptushkin | Sciencx - Accessed . https://www.scien.cx/2024/07/15/gitlab-python-based-job-to-remove-stale-branches/
IEEE
" » Gitlab python-based job to remove stale branches." Artem Ptushkin | Sciencx [Online]. Available: https://www.scien.cx/2024/07/15/gitlab-python-based-job-to-remove-stale-branches/. [Accessed: ]
rf:citation
» Gitlab python-based job to remove stale branches | Artem Ptushkin | Sciencx | https://www.scien.cx/2024/07/15/gitlab-python-based-job-to-remove-stale-branches/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.