1

I would like to export in tar a full project with all its branches using git and bitbucket. Is it possible to do that ?

Thank you very much !

Tom
  • 143
  • 1
  • 11
  • The `tar` command makes an archive. A Git repository contains commits—usually thousands of commits—and *each commit is a complete archive of all files*, so `tar` is typically used as a transfer mechanism for the archive extracted from *one commit*. If you want to make a copy of a Git repository, use `git clone` to make a copy of *every* commit (but no branches: all branch names become remote-tracking names instead). – torek May 27 '21 at 07:21
  • So you wanna say I have to do a git clone and then using the command tar ? But If I do that will I have all the branches with the latest modificiations without internet connection ? – Tom May 27 '21 at 07:26
  • I'm not saying that you *have* to do that, but that's the *easy* way to do it. If you want to build a skyscraper one molecule at a time, that's your business, but it's going to take a lot of work. Consider making a clone with `git clone --mirror` and then using `git bundle` to turn the clone into a more-easily-transported file. – torek May 27 '21 at 07:29

1 Answers1

1

So you wanna say I have to do a git clone and then using the command tar

As torek comments, git clone --mirror + git bundle create repo.bundle --all is the official way to create one file from a repository, with all its history and branch.

Doing it without cloning would means setting up a remote action on the repository hosting service itself, like GitHub Actions on a GitHub repository, in order to build that archive on each new commit.
That has not been done yet, as far as I can see.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250