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 8138737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:35:32+00:00 2026-06-06T11:35:32+00:00

Is there a way to specify the maximum recursion level for recursive diff diff

  • 0

Is there a way to specify the maximum recursion level for recursive diff diff -r (to compare two directories)?

What I’m trying to do is compare two projects on github (one was branched from another). I now suspect there may be a remote branch in one of them that links to the other, which will let me do a diff from git, however the question still applies to filesystems in general.

Edit-Update: This answer addresses how I might have git help me perform a comparison: https://stackoverflow.com/a/5162839/340947

What’s been happening is I have cloned both repos and I am calling diff -r repoA repoB and it reports differences in the .git/ dirs, which is to be expected, yet I am uninterested in differences within these directories.

In this case it would be perfect to just show diffs between the first-level files in the directories, because this particular project does not have subdirs. If anyone has tips for how to compare two dirs while excluding particular folders (the .git/ dirs in my case) that’d be great too!

  • 1 1 Answer
  • 0 Views
  • 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-06-06T11:35:34+00:00Added an answer on June 6, 2026 at 11:35 am
    1. I’m not aware of any way of limiting the depth of recursion with diff -r.

    2. You can exclude files that match a pattern with -x PAT or --exclude=PAT. So

      diff -r -x .git repoA repoB
      

      would be useful if you did want recursion.

    3. In your case, just leave off the -r since you don’t want it to recurse.

      diff repoA repoB
      

      already does what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to specify one layout for portrait mode and another to
Is there a way to specify a one dimensional array in a ini file.
Is there a way to specify the maximum number of characters allowed in an
Is there a way to specify that one of 2 attributes is required in
Is there a way to specify an ANT file to run only one/some/all of
Is there a way to specify include directories in the code, perhaps via a
Is there a way to specify maximum execution time of an ajax post to
Is there a way to specify default JVM arguments when I'm running my code
Is there any way to specify what specific type of object can be contained
Is there any way to specify that a function should be called when a

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.