Back to Gitlabhq

Keep-around orphaned reference Rake task

doc/administration/raketasks/keep_around.md

18.11.21.0 KB
Original Source

{{< details >}}

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab Self-Managed

{{< /details >}}

{{< history >}}

  • Improvements to Rake task introduced in GitLab 18.4.

{{< /history >}}

gitlab:keep_around:orphaned generates a CSV report of every keep-around reference in the project repository and every database reference to a Git commit.

The CSV report has three columns:

  • The type of reference. Either keep for a keep-around reference or usage for a database reference.
  • The Git commit ID.
  • The source of the reference if known. For example, Pipeline.

Run orphaned reference report

{{< tabs >}}

{{< tab title="Linux package (Omnibus)" >}}

shell
sudo gitlab-rake gitlab:keep_around:orphaned PROJECT_PATH=project/path FILENAME=/tmp/report.csv

{{< /tab >}}

{{< tab title="Self-compiled (source)" >}}

shell
bundle exec rake gitlab:keep_around:orphaned RAILS_ENV=production PROJECT_PATH=project/path FILENAME=/tmp/report.csv

{{< /tab >}}

{{< /tabs >}}