5

So I have the following branches in my Github repo: (follows "git flow")

  • master (latest stable: 1.1.0)
  • develop (2.0.0)
  • feature/feature_in_dev
  • feature/other_feature_in_dev
  • release/1.0.0
  • release/1.1.0

I already know how to create branch aliases, such as for the releases. I could technically remove the composer.json file each time I add a new feature branch and then commit it back in once I am ready to merge it into develop, but that would be very annoying and easy to forget.

My Question: How can I hide the feature branches from Packagist?

Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
Nicholas Summers
  • 4,444
  • 4
  • 19
  • 35
  • Why do you want to hide the feature branches from Packagist? – Danack Oct 05 '14 at 23:34
  • because `develop` is usually at least semi-stable whereas feature branches are almost always unstable up until they can be merged into `develop`. Basically installing from a feature branch will pretty much always break your system. – Nicholas Summers Oct 05 '14 at 23:38
  • Unless some specifies a branch specifically, they won't get it by accident...so why do you want to hide the feature branches from Packagist? – Danack Oct 06 '14 at 00:49
  • The same reason why you hide candy from a diabetic: they know they shouldn't have it, but some of them just can't help themselves. In this case, I'll get blamed if they don't know any better. It is much easier to just remove known issues from the general public's view. – Nicholas Summers Oct 06 '14 at 01:04
  • Bad analogies are bad...and trying to stop other people making mistakes is usually a waste of time. If you really wanted to, you could have a separate repo for doing development in, and only merge to the main repo when you're happy with the code. That's how Zend appears to be developed - the individual people develop in forks, and then only merge to the main repo after a code review. – Danack Oct 06 '14 at 10:05
  • @NicholasSummers For the record I think that was a great analogy. Did you find another solution? – cfkane Nov 16 '20 at 08:23

1 Answers1

1

A branch can be hidden from packagist if the branch doesn't contain a composer.json file in the root folder.

Attila Fulop
  • 6,861
  • 2
  • 44
  • 50