blt icon indicating copy to clipboard operation
blt copied to clipboard

DX-5121: Add an option for blt deploy to reset target branch history

Open vbouchet31 opened this issue 3 years ago • 1 comments

When using BLT to deploy artifact to Acquia Git repository, BLT is generating a commit to the target branch.

However, we often don't really need to keep an history of commits on the Acquia Git repository and it is expected that artifacts can be regenerated at any time from the source repository. With long and big projects, the Acquia Git repository size tend to grow and make code deployment longer due to the size. A workaround is to periodically and manually reset the target branch history. It would be an interesting feature to have in blt deploy to reset the target branch history.

These are the commands I used so far for my testing:

git checkout $branch_name
git checkout --orphan $branch_name-tmp
git add .
git commit -m "Fresh orphan branch." --quiet
gir branch -D $branch_name
git branch -m $branch_name
git push -f origin $branch_name

vbouchet31 avatar May 31 '22 09:05 vbouchet31

Any update or direction from the BLT team on this ?

morvans avatar Jan 22 '24 14:01 morvans