[Spacewalk-devel] A Note Regarding Recording Git Commit IDs

Jan Pazdziora jpazdziora at redhat.com
Mon Jun 30 07:46:15 EDT 2008

On Fri, Jun 27, 2008 at 03:21:53PM -0300, Devan Goodwin wrote:
> Just realized something, I was completing a bugzilla and went to note
> the git commit hash in the ticket, but i hadn't yet merged my branch
> back into master and pushed. Because commits are identified by a hash of
> the entire tree, if something's changed in master since you branched and
> you end up rebasing, the tree is modified and then your change is
> re-applied on top of those changes, resulting in a new hash.
> Basically if you're recording a commit ID make sure you only look it up
> after you've successfully merged into master and pushed! Otherwise it

That pushed is a key, here. You can avoid the change of the commit
SHA1 by not rebasing but just merging (which will make that branch you
had visible). However, not matter what way you take, if the commit is
only in your local repository, you may git-reset it or lose the local
disk ... and that SHA1 will never be made available to others.

Jan Pazdziora
Satellite Engineering, Red Hat

More information about the Spacewalk-devel mailing list