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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:52:10+00:00 2026-05-11T08:52:10+00:00

I removed 777 files which were in Git’s branch newFeature by rm !(example) I

  • 0

I removed 777 files which were in Git’s branch newFeature by

rm !(example) 

I would like to commit. Git ask me to manually remove each of the removed files by

git rm file 

It would take a lot of time to write the above command for all 777 files which names are not similar.

How can I remove these 777 files in my Git branch newFeature? I want to keep them as a backup for later use, but now, I want to be without them.

  • 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. 2026-05-11T08:52:11+00:00Added an answer on May 11, 2026 at 8:52 am
    git add -u 

    It will ‘git delete’ all files you removed.

    From Git add:

    u
    –update

    Update only files that git already knows about, staging modified content for commit and marking deleted files for removal.
    This is similar to what ‘git commit -a‘ does in preparation for making a commit, except that the update is limited to paths specified on the command line.
    If no paths are specified, all tracked files in the current directory and its subdirectories are updated.


    The ‘plumbing way’ was indeed some kind of script one-line

    for i in ` git st | grep deleted | awk ‘{print $3}’ ` ; do git rm $i; done 

    or for Windows box with GnuWin32

    git st | grep deleted | gawk '{print \'git rm \'$3}' | cmd 

    But git add -u is the main porcelain way to do it.

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

Sidebar

Related Questions

I removed some files from git index , using git rm --cached . Those
I've removed a checked in file from the CVS branch, i.e.: cvs remove -f
I removed my .gitconfig by accident. I added new identies by git add [file]
I was removed icon applicaion like this -> http://www.helloandroid.com/tutorials/removing-app-icon-launcher But I can't launch it
After some code review I removed unnecessary properties which resulted in empty rules. So
I removed one of my files from a project in PhpStorm 3.0, but now
I removed a file in my local Git repo. I want the file back
EDIT: Removed the files from the server http://www.jdxsolutions.com/newsite/index.html http://www.jdxsolutions.com/newsite/default.css This is a layout I've
If I have added/removed/modified a large number of files in my local ClearCase view,
Some other CSS files removed the border around all GWT CaptionPanels. Now I'm looking

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.