Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I modified a file, i know exactly which one it was but it turns out i didn't merge it with master. I have no idea what branch I put it in but it was no later then 2 months ago but no sooner then last month

Is there a way I can ask git when the last time i modified a specific file but ask to check every branch instead of just my current?

share|improve this question
up vote 2 down vote accepted
git log --all --since="2 months ago" --until="2 weeks ago" -- path/to/file

If you also need branch names for a specific commit, use git branch --contains commit-id.

share|improve this answer
I'll try this out tomorrow when i'm at my seat – acidzombie24 Jan 24 '13 at 2:13

I don't know of a quick way to do this for a single file across every branch (only git diff between two branches), but I would definitely use git blame and/or git diff to figure out the rest if you wind up having to do this branch by branch.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.