On Thu, Mar 21, 2013 at 12:48:59PM -0700, Brian Jones wrote:

> In out of the box git, do commits remember the name of the branch that 
> created them? If so, what command can I use to see that information? My 
> assumption is that commits do not record branch names but I want 
> confirmation.

They do not.

Remember that Git was concieved with the Linux kernel in mind, and its
development uses a hierarchical approach where patches flow through many
staging trees so that names of actual branches in each of them have no
sense at all to the final result (look at the tree picture at [1] to get
better idea of that).

For small projects, the idea of keeping track of the originating branch
is not really so absurd, so some sort of a policy might be used for
this.  For instance, a prefix codifying a feature being developed might
be inserted in commit messages' headers.  Or a prepare-commit-msg hook
might be used to automatically insert some custom field in commit
messages.

Another approach (described in [2], for instance) is to never use
fast-forward merges of feature branches back into their originating
branches, and describe the feature in the integration merge commit.
This is not a solution to the problem as stated, but if you just want
better understanding of the project's history, this might be the way to
go.

1. http://lwn.net/Articles/318699/
2. http://nvie.com/posts/a-successful-git-branching-model/

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to