12

I develop on several machines. I want to have a repository for each of my projects on each development machine, and I would like to keep them in sync without using a remote repository I can push to. (For now I cannot afford a dedicated machine for that purpose).

I think git bundle is the right tool for the job. I simply bundle my repo when I am done working on machine A, and unbundle on machine B. This leaves me with this questions:

Is it possible to embed information about tags and branches in the bundle? In particular, how can I bundle tag objects?

EDIT: Just a note aside - I want to keep this workflow as automated as possible. I do not want to treat the bundle as a remote. Rather than that, I would like to duplicate the bundle into my repository - that is add commits and tags, fast-forward existing branches and add new branches if the branch does not exist.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
MaxB
  • 121
  • 1
  • 4

1 Answers1

14
git bundle create RA.bundle --branches --tags

would include informations about all tags and all branches.

git bundle takes a list of arguments, acceptable to git rev-parse and git rev-list (and containing a named ref, see SPECIFYING REFERENCES), that specifies the specific objects and references to transport.

--branches[=<pattern>]

Pretend as if all the refs in refs/heads are listed on the command line as <commit>.
If <pattern> is given, limit branches to ones matching given shell glob.
If pattern lacks ?, , or [, / at the end is implied.

--tags[=<pattern>]

Pretend as if all the refs in refs/tags are listed on the command line as <commit>.
If <pattern> is given, limit tags to ones matching given shell glob.
If pattern lacks ?, , or [, / at the end is implied.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 4
    Anyone figured out how to do this including tags that are in a commit range, as opposed to all tags like the above solution does? – robinspb Jul 31 '14 at 19:56
  • 2
    @robinspb You can do like `git bundle create ^fromReference currentReference`. for commit range. – Kishor Pawar Sep 26 '16 at 10:01