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

The Archive Base Latest Questions

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

I am adding source control to a project that had none. The problem is

  • 0

I am adding source control to a project that had none. The problem is that there are a lot of files to initially add to git with a .gitignore file, but I can’t figure out how to add all files without including the files matching something in the .gitignore file.

git add *

The above command will not add any files because it detects files which are ignored by the .gitignore.

git add -f *

The above command will add all files including the files I wish to ignore.

So, how do I add all files while still adhering to the .gitignore file?

  • 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-23T19:12:23+00:00Added an answer on May 23, 2026 at 7:12 pm

    I think you mean git add . which will add all of the files to the repo that AREN’T specified in the .gitignore – you can see these changes by typing git status

    The . in bash usually means this directory and all other directories recursively, so if you do this from the bottom level of your repo, you should add all of the files.

    My usual git flow is to create the .gitignore file and add the project files to the repo. I’ll test the .gitignore file by typing git status after importing the files – if I see the files that I’ve added (for example only .php or .html, NOT .mp3 or .mov), then you can git add . to add all, and git commit -m "initial commit" to commit them and you should be set.

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

Sidebar

Related Questions

With Source Safe, after I add files to Source Control, they are set read-only
Is there any way I can add an existing folder to source control in
Adding source files more than one directory away (e.g. ../../source.cpp or ../../../somewhere_else/source.cpp, vs. just
Short version: I have an MSBuild project that imports another project. There is a
I have a problem with a WPF control that I'm trying to host in
I am adding my code to source control (SVN). I am trying to organize
I have a solution that is checked into our TFS source control repository, but
Has anyone had any experuience using web-based PVCS (Serena) source control app for Visual
I have a problem with adding parameters to EventHandler. I have a control when
I have to use a user control form In that form, there is a

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.