From 5f06ff6172fb0e2f4d3df4eef6910d4ee77a6b74 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Mon, 23 Dec 2024 16:22:38 +0800 Subject: [PATCH] Remove `git reset --hard` command in web template to reduce layer size I noticed that use running `git reset --hard` results in ~133MB being added to the final layer generated by `launcher bootstrap`. However, I can not figure out why we would need to run `git reset --hard` at all. Even if there is a reason to run `git reset --hard`, it should not be the default. If someone for whatever reason needs to run `git reset --hard`, they should do so using the `before_code` hook. --- templates/web.template.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/web.template.yml b/templates/web.template.yml index d5dd09526..7f93b5492 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -91,7 +91,6 @@ run: cd: $home hook: code cmd: - - sudo -H -E -u discourse git reset --hard - sudo -H -E -u discourse git clean -f # TODO Remove the special handling of shallow clones when everyone uses images without that clone type - |-