Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 952537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:54:33+00:00 2026-05-15T23:54:33+00:00

In Git, how could I compare the same file between two different commits (not

  • 0

In Git, how could I compare the same file between two different commits (not contiguous) on the same branch (master for example)?

I’m searching for a compare feature like the one in Visual SourceSafe (VSS) or Team Foundation Server (TFS).
Is it possible in Git?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:54:34+00:00Added an answer on May 15, 2026 at 11:54 pm

    From the git-diff manpage:

    git diff [--options] <commit> <commit> [--] [<path>...]
    

    For instance, to see the difference for a file “main.c” between now and two commits back, here are three equivalent commands:

    $ git diff HEAD^^ HEAD main.c
    $ git diff HEAD^^..HEAD -- main.c
    $ git diff HEAD~2 HEAD -- main.c
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

git diff master..lab It will produce the diff between the tips of the two
Here's an example: >git status # On branch master nothing to commit (working directory
Currently my terminal prompt includes git information. Example clean directory: michaelespinosa:~/Sites/example.com [git:master] Example dirty
git bisect works by counting the number of commits between 'good' and 'bad' and
My .gitignore file seems to be being ignored by Git - could the .gitignore
I'm working on a git repository that has a branch off of master, we'll
In Git, how could I search for a file or directory by path across
git status tells me that my branch and the one I started from on
Git is implemented as a directed acyclic graph. Children know their parents but not
git-cherry lets me find all the commits missing from upstream. How do I find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.