0

I'm trying to share our git repo with an offsite development team. We do not have a "master" branch. We have A/master, B/master, and C/master. I have a symbolic ref in my pub repo

HEAD -> refs/heads/B/master

When I create the bundle git bundle create my.bundle --remotes --tags I end up with two references to refs/remotes/origin/B/master and that causes git clone --mirror my.bundle to fail. Is there a way to ignore the symbolic ref?

EncryptedWatermelon
  • 4,788
  • 1
  • 12
  • 28
  • 1
    The simplest would be to use `git rev-parse` to turn `--remotes` into the actual full names (`git rev-parse --symbolic-full-name --remotes`), then filter the list down. (You can include `--tags` in the rev-parse set, if you like, making them available for filtering too, or pass `--tags` directly to `git bundle` as before.) – torek Jul 11 '19 at 22:43
  • Thanks! I used '`'` instead of '(' to execute the rev-parse. If you post it as a solution I'll accept it. – EncryptedWatermelon Jul 12 '19 at 11:59

1 Answers1

1

I'd probably use:

git bundle create my.bundle \
    $(git rev-parse --symbolic-full-name --remotes --tags | grep -v HEAD)

or something along these lines. (The line break with backslash is mostly for posting purposes, and watch out for this removing too many HEAD entries, e.g., if you have a remote-tracking name or tag name like getAHEADofit.)

torek
  • 448,244
  • 59
  • 642
  • 775