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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:10:29+00:00 2026-06-15T10:10:29+00:00

Currently, whenever I create a file that I’d like Git to track I simply

  • 0

Currently, whenever I create a file that I’d like Git to track I simply add it to the index. If I don’t add it to the index Git would not “see it”. So why should I use a .gitignore file, as opposed to just not adding it to the index?

  • 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-15T10:10:30+00:00Added an answer on June 15, 2026 at 10:10 am

    You’ll generally find that adding each and every file one by one can become tedious when your project becomes bigger.

    In Java, you may end up with many .class files that you wouldn’t want to add to your repository. Similarly, you may end up with many .o files in C, or .pyc in Python (for example).

    Having patterns like *.class, *.o, *.pyc in your .gitignore files allows you to ignore those files once and for all. Subsequent git status runs (or similar if you’re using a GUI) will not tell you these are new, untracked files, thereby letting you focus on the files that are really new and noticeably untracked.

    This can also be useful if you add an entire directory (e.g. git add myproject): this lets you ignore a category of files altogether.

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

Sidebar

Related Questions

I want to create a simple Blackberry app that plays an audio file whenever
I would like to add a file to my project, who's sole purpose would
Currently we are running multiple Sitecore projects. Whenever the projects go live we create
Currently whenever the timestamp is echo'ed it looks like this function show_posts($userid){ $posts =
I currently have a delayed task that runs whenever I click a button. Clicking
I am currently trying to write an addin for PowerPoint that whenever any PowerPoint
I would like to run an sql query whenever i publish a post. Im
I want to create a core dump whenever my process crashes. Currently I am
I am currently stuck at the part whenever I drag a HTML5 slider, it
I have an element which autosaves its contents via an AJAX call. Currently, whenever

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.