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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:48:12+00:00 2026-05-23T11:48:12+00:00

I have a git repository hosted on Github. After committing many files, I am

  • 0

I have a git repository hosted on Github. After committing many files, I am realizing that I need to create .gitignore and exclude .exe, .obj files.

However, will it automatically remove these committed files from the repository? Is there any way to force that?

  • 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-23T11:48:13+00:00Added an answer on May 23, 2026 at 11:48 am

    No you cannot force a file that is already committed in the repo to be removed just because it is added to the .gitignore

    You have to git rm --cached to remove the files that you don’t want in the repo. ( –cached since you probably want to keep the local copy but remove from the repo. ) So if you want to remove all the exe’s from your repo do

    git rm --cached /\*.exe
    

    (Note that the asterisk * is quoted from the shell – this lets git, and not the shell, expand the pathnames of files and subdirectories)

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

Sidebar

Related Questions

I have a git repository (at github.com) with two branches: master and gh-pages. I
Backround: Suppose I have the following Git URLs (hosted on github) http://github.com/mikl/drupal.git git://github.com/mikl/drupal.git (Git
I have a git repository hosted on a server. We are 5 members in
I have made a bare repository (MY_LOCAL_REP) out of a public git repository hosted
I have a Git repository and I'd like to see how some files looked
I have 2 servers. The hosted rails app server and git repository server. The
I am using git-svn to develop code that is hosted on a SVN+SSH repository.
I have a git repository (and working directory) that is stored in my Dropbox
I have a git repository with two branches; one for code that's used for
I have a git repository that is just a directory tree (/myprogram/src/com/mycompany/test) with some

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.