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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:24:30+00:00 2026-06-12T16:24:30+00:00

I removed a few files from my git repo and now, upon status see

  • 0

I removed a few files from my git repo and now, upon status see

# Changes not staged for commit:
# ...
#   deleted:    project/war/favicon.ico
#   deleted:    project/war/index.html

Usually, i would stage them by issuing git add . command, but doing so does not affect git status. Files are still not staged for commit.

Now .. i know i can git rm file to take care of this.

The question is … can i modify git add . somehow to also stage deleted files as well? I thought add “.” takes care of everything (deleted files included)

  • 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-12T16:24:32+00:00Added an answer on June 12, 2026 at 4:24 pm

    git add . will add new and modified files to the index. git add -u will delete files from the index when they are deleted on-disk and update modified files, but will not add new files. You need a combination of the two:

    git add . && git add -u .
    

    Addendum: It appears that the -A switch will catch all three: added, modified, and deleted files.

    git add -A .
    

    Note the extra ‘.’ on git add -A and git add -u


    Warning, starting git 2.0 (mid 2013), git add -A|u (not extra dot) will always stage files on the all working tree.
    If you want to stage file only under your current path with that working tree, then you need to use

    $ git add -A .
    

    See “Difference of “git add -A” and “git add .”“.

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

Sidebar

Related Questions

I added a few files to my git repo. I then added a directory
The problem is strange: I removed from Array (association) a few elements by splice
DockingManager control has been removed from their suite in Q1 2011, so now I
I am invoking camera from my application. i want to remove few menu items
I removed the settings.bundle from an app I'm working on as it's no longer
I removed my .gitconfig by accident. I added new identies by git add [file]
I removed, what at the time I thought, was an unnecessary field/column from a
I have removed all header files within the below path due to numerous errors
A colleague has done a few things I told them not to do: forked
I am using Perltidy to reformat a few of my old Perl files to

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.