buildah icon indicating copy to clipboard operation
buildah copied to clipboard

`ADD --keep-git-dir` support missing

Open mnaser opened this issue 1 year ago • 2 comments

Hi there!

I'm happy to see that the ADD now supports git repositories, however, Docker supports a --keep-git-dir flag which allows you to interact with the repository if you want to fetch tags or anything else after.

Can we look into adding support for that to provide parity?

Thanks, Mohammed

mnaser avatar Jan 17 '25 22:01 mnaser

Not sure I understood the issue. Do you want to be able to use --keep-git-dir to not fetch the git directory? That flag doesn't affect fetching tags or other git objects. You should be able to fetch tags and branches with the current implementation btw.

https://github.com/containers/buildah/blob/833420ea0b4f1d7944faa2400b67331f6c8aad92/tests/bud.bats#L7036-L7037

danishprakash avatar Jan 21 '25 07:01 danishprakash

I just ran into this issue too. The --keep-git-dir is helpful when you want to subsequently fetch submodules with git submodule update --init --recursive which requires the .git directory to be present.

lrowe avatar Mar 21 '25 19:03 lrowe