0

How can I see the names of "local" git branches of a cloned repo from the repo server? I have 8-10 developers and I want to insure they are using branch naming standards on their local machines.. Is that possible?

1 Answers1

0

That is what I was explaining in "Definition of “downstream” and “upstream”":

The DVCS (Distributed Version control System) twist is: you have no idea what downstream actually is, beside your own repo relative to the remote repos you have declared.

  • you know what upstream is (the repos you are pulling from or pushing to)
  • you don't know what downstream is made of (the other repos pulling from or pushing to your repo).

You cannot see the downstream repos and their branches: they can see you. Not the reverse.

What you can do is setup a pre-receive hook which would enforce a branch-naming policy and reject any push to a branch not matching that policy.

See for instance this hook:

# if this is a branch with a prefixed name...
if echo $ref | grep -q "^refs/heads/.*-" ; then
...
else # branch does not have a prefix on the form 'prefix-*'
  echo "$ref is not a valid branch name. Please consult the naming conventions."
  exit 1;
fi
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250