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

  • SEARCH
  • Home
  • 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 8554685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:56:21+00:00 2026-06-11T14:56:21+00:00

I’m finally getting used to Git and, after the initial steep learning curve, I

  • 0

I’m finally getting used to Git and, after the initial steep learning curve, I must say it’s quite good (I just miss the single file externals, but that’s another story). I have, however, an issue that I can’t solve: I’m currently working on a dozen projects at the same time. They are all interconnected and I must jump from one to the other, making changes here and there.

All good so far, I can “juggle” them quite easily, I commit changes regularly and so on. The issue is that, after several hours, I don’t remember which projects I pushed to the remote repository. Of course, I can “cd” into each project’s directory and issue the push command, but it’s tedious. I was wondering if there would be a way, using bash, to run something like a git find all unpushed commits in all projects in this directory. Such command would be run from a directory which is not a Git repository, but which contains a tree of all the projects.

The logic is simple, but the implementation seems quite complicated, also because, although the root directory contains all the projects, the actual Git repositories can be found at any level from the starting directory. For example:

  • projects directory
    • customer X
    • project1 (Git repo)
    • customer U
    • project2 (Git repo)
    • project3
      • somelibrary (Git repo)
      • theme (Git repo)

In this example, only directories in bold are Git repositories, therefore the check should be run inside them. I’m aware that the structure looks a bit messy, but it’s actually quite easy to handle.

Any help is welcome, thanks.

  • 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-11T14:56:23+00:00Added an answer on June 11, 2026 at 2:56 pm

    You can find unpushed commits with git cherry, so you should be able to write a bash script like

    #!/bin/bash
    for file in `find ./ -type d -maxdepth 3` ; do
        cd $file
        git cherry -v
        cd -
    done
    

    which will find 3 layers of subdirectories, but it’s probably not very nice to look at.

    EDIT

    As Evan suggests you can use a subshell to avoid cd-ing back a directory, like so

    #!/bin/bash
    for file in `find ./ -type d -maxdepth 3` ; do
        (cd $file && git cherry -v)
    done
    

    You might want to put a pwd command in here somewhere to see which file/directory you’re in…

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.