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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:20:39+00:00 2026-05-30T21:20:39+00:00

So the command to stage all changes for git is git add -A .

  • 0

So the command to stage all changes for git is git add -A.

Is there a way to execute this from within a repository subdirectory, and capture all changes anywhere in the repo, without having change the directory back to the repo root?

Example:

$pwd
/reporoot/

modify the file: /reporoot/a-file

$cd /a-subdir

$git 'magic variation of add -A which I'm looking for'

and the change to /reporoot/a-file will be staged.

I find that I’m often in one place in the terminal, but editing a file somewhere else with the IDE, so the answer to this question would be a helpful way for avoiding lots of cd’ing.

  • 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-05-30T21:20:40+00:00Added an answer on May 30, 2026 at 9:20 pm

    Use the following (only works in newer versions of Git):

    git add $(git rev-parse --show-toplevel)
    

    You may wish to create a Git alias for this to make running it easier.

    Note that, if you plan on committing, doing the following will stage all changed files already in the working tree (i.e., not untracked files):

    git commit -a
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there command which can show me list of all available commands in GIT?
What command would I execute to safely change (i.e. from int to bigint) a
In my Git repo, I changed some files. I want to stage all of
What command checks if a directory exists or not within a Bash shell script?
Via command line, I usually do this: cp -rRp /path/to/a\_folder/. /path/to/another\_folder This copies just
The command get executed without the need of pressing Enter. This can be dangerous
Situation: Edit files Add files to the index with git add (these files are
I've moved files from Project to Project/src . Git is under the impression that
This is my first time using any sort of version control (git) and excited
I have a git repository with some commits in it. I want to reproduce

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.