# Is there a way to mark a branch as published?

3 messages from 2014-07-29 to 2014-08-01. Participants: Nico Williams, Dennis Kaarsemaker.
Thread: https://gitlist.dev/t/37244

## Nico Williams, 2014-07-29 22:40

Subject: Is there a way to mark a branch as published?
Message-ID: <CAK3OfOjPQ1fcoA7O6EDcQ3iW_AdsjitK4WKSdLwpRRXm8xfrVA@mail.gmail.com>
URL: https://gitlist.dev/e/CAK3OfOjPQ1fcoA7O6EDcQ3iW_AdsjitK4WKSdLwpRRXm8xfrVA%40mail.gmail.com

```
(or all of a repo's branches)

Teamware recorded whether it had any "children" and warned about
rebasing published contents.  Perhaps git could do the same.

Nico
--

```

## Dennis Kaarsemaker, 2014-08-01 18:58

Subject: Re: Is there a way to mark a branch as published?
Message-ID: <1406919490.3253.3.camel@spirit>
URL: https://gitlist.dev/e/1406919490.3253.3.camel%40spirit
In-Reply-To: <CAK3OfOjPQ1fcoA7O6EDcQ3iW_AdsjitK4WKSdLwpRRXm8xfrVA@mail.gmail.com>

```
On di, 2014-07-29 at 17:40 -0500, Nico Williams wrote:
> (or all of a repo's branches)
> 
> Teamware recorded whether it had any "children" and warned about
> rebasing published contents.  Perhaps git could do the same.

Git doesn't record this directly, but you can see which known remote
branches contain the tip of a branch:

git branch -a --contains yourbranchnamehere | grep remotes/

That doesn't say anything about remotes you don't know about of course.
-- 
Dennis Kaarsemaker
www.kaarsemaker.net

```

## Nico Williams, 2014-08-01 19:17

Subject: Re: Is there a way to mark a branch as published?
Message-ID: <CAK3OfOgxngLhh7FjrBT9NcK=LhEH9TAz+18LAvXJtt_bV=96wA@mail.gmail.com>
URL: https://gitlist.dev/e/CAK3OfOgxngLhh7FjrBT9NcK%3DLhEH9TAz%2B18LAvXJtt_bV%3D96wA%40mail.gmail.com
In-Reply-To: <1406919490.3253.3.camel@spirit>

```
On Friday, August 1, 2014, Dennis Kaarsemaker <dennis@kaarsemaker.net> wrote:
>
> On di, 2014-07-29 at 17:40 -0500, Nico Williams wrote:
> > (or all of a repo's branches)
> >
> > Teamware recorded whether it had any "children" and warned about
> > rebasing published contents.  Perhaps git could do the same.
>
> Git doesn't record this directly, but you can see which known remote
> branches contain the tip of a branch:

Yes, but that says nothing about whether they accept non-ff merge
pushes, or should reject them, and it says nothing about whether they
are intended to be seen as "published" in the sense of having stable
history.  (Teamware would mark repos as published when cloned, but
that often meant needing to reset that flag [it wasn't a flag, but i'm
eliding irrelevant details].)

Yes, non-fast-forward pushes can be rejected with a hook, but a flag
that could be set with a git command would be more convenient.

```
