Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to git's <a href="http://book.git-scm.com/1_the_git_object_model.html" rel="nofollow noreferrer">Object Model</a> if you only change the meta-data of a commit (i.e. commit message) but not the underlying data ("tree(s)") contained within it then it's Tree hash will remain unchanged.</p> <p>Aside from editing a commit message, you are also performing a rebase, which will change the Tree hashes of each commit in your history, because any changes pulled from <code>origin/master</code> will affect the files in your re-written history: which means some of the files (blobs) that your commit points to have changed.</p> <p>So there is no bullet-proof way to do what you want.</p> <p>That said, editing a commit with <code>rebase -i</code> does not usually alter the commit's timestamp and author, so you could use this to uniquely identify your commits before and after a rebase operation.</p> <p>You would have to write a script which records all the branch start-points against these "timestamp:author" identifier before doing a rebase, and then find the rewritten commits with the same "timestamp:author" ID and rebase the branch on it.</p> <p>Sadly, I don't have time to try writing this script myself now, so I can only wish you the best of luck!</p> <p><strong>Edit</strong>: You can obtain the author email address and timestamp using:</p> <pre><code>$ git log --graph --all --pretty=format:"%h %ae:%ci" * 53ca31a robert.meerman@gmail.com:2010-06-16 13:50:12 +0100 * 03dda75 robert.meerman@gmail.com:2010-06-16 13:50:11 +0100 | * a8bb03a robert.meerman@gmail.com:2010-06-16 13:49:46 +0100 | * b93e59d robert.meerman@gmail.com:2010-06-16 13:49:44 +0100 |/ * d4214a2 robert.meerman@gmail.com:2010-06-16 13:49:41 +0100 </code></pre> <p>And you can obtain a list of branches for each of these based on their commit hash:</p> <pre><code>$ git branch --contains 03dda75 * testbranch </code></pre> <p>Watch out for multiple branches per commit, the common ancestor <code>d4214a2</code> belongs to both branches!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload