LibreOffice can save files in .fodt which is a nice text format that you can edit and then read back in LibreOffice. The .fodt format contains the same information as the binary version.

Is there something similar for git?

Maybe something like:

git --export-as-ascii /tmp/myrespository.txt
<<edit /tmp/myrespository.txt>>
cd new-place
git --import /tmp/myrespository.txt

It should export everything (tags, branches etc) and be as editable as possible.

I understand that checksums will ofcourse be changed if you change the text, and in that case I would love if git gives a warning and then just tries computing new checksums.

  • Tar it up and run base64 (or uuencode) over it? – Kusalananda Aug 5 at 9:53
  • git format-patch, edit to your hearts content, and git am? – muru Aug 5 at 10:48
  • @Kusalananda That is not edit friendly. – Ole Tange Aug 5 at 12:16

"Export" and "import" of Git can be done through what is called a "bare" repository. git clone --bare URL PROJECT.git to create a directory "PROJECT.git" containing just the Git metadata. You can then clone that normally to create a checked-out repo.

If you want that as a single file I would just tar it up.

Conversely, if you only want the contents of a Git repository without the history you can git checkout-index --all --prefix="../$(basename "$(git rev-parse --show-toplevel)")-copy/" to create it as a "PROJECT-copy" sibling directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.