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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:41:20+00:00 2026-06-06T10:41:20+00:00

This happens almost every time I init a new repo. Start a new project.

  • 0

This happens almost every time I init a new repo.

  1. Start a new project. Create a bunch of new files.

  2. git init

  3. git add .

  4. Oh shoot, there’s some IDE/build cruft I need to ignore.

  5. echo ".scons-nodecount" > .gitignore

  6. Dammit, .gitignore doesn’t see it because this file has already been added.

  7. git reset .scons-nodecount

  8. Dammit, git reset doesn’t work because there’s no commits yet.

    … not sure what to do here, so …

  9. Start over: rm -rf .git

— edit —

How do I remove a file from the index on a fresh repo? git reset is what I’d traditionally do, but it seems like this isn’t allowed if there are no prior commits.

  • 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-06T10:41:23+00:00Added an answer on June 6, 2026 at 10:41 am

    I do the same thing all the time. Try git rm --cached .scons-nodecount. This will instruct Git to remove the file, but only from the index (--cached).

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

Sidebar

Related Questions

some weeks from now I've been receiving this strange message almost every time I
Almost every time I use the iPhone Simulator, I get intermittent slowdowns. Everything is
This happens after I hit Build and Go to run my app on my
This happens in IDLE and Windows 7 RC1 (if that helps). Here is the
I am authenticating users in ldap, but this happens only once, when user is
I need to catch segmentation fault in third party library cleanup operations. This happens
MacPorts installed libiconv @1.14_0+universal as a dependency on my system. This happens to be
Sometimes users mistakenly redirected to ?Process=ViewImages&PAGEID=. When this happens, they get the following error.
This only happens in some IE's. Here: http://animactions.ca/Animactions/volet_entreprise.php You may notice that when you
This only happens in IE. I'm using swfobject and loading the flash vars as

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.