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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:37:49+00:00 2026-05-21T03:37:49+00:00

I added a few files to my git repo. I then added a directory

  • 0

I added a few files to my git repo. I then added a directory and moved them into there. I then added the directory using git add

What does this mean tell me?

On branch master

Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

new file:   newDir/TMXParser.c
new file:   newDir/Tilemap.c
new file:   newDir/test.xml
new file:   newDir/tileImage2.png
new file:   TMXParser.c
new file:   Tilemap.c
new file:   test.xml
new file:   tileImage2.png

Changed but not updated:
 (use "git add/rm <file>..." to update what will be committed)
 (use "git checkout -- <file>..." to discard changes in working directory)

deleted:    TMXParser.c
deleted:    Tilemap.c
deleted:    test.xml
deleted:    tileImage2.png

Untracked files:
(use "git add <file>..." to include in what will be committed)

.DS_Store

Are the files being added twice if I commit? How do I remove this .DS_Store from terminal?

  • 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-21T03:37:50+00:00Added an answer on May 21, 2026 at 3:37 am

    The proper way would have been to use git mv to move the files into the directory; as it stands you can simply git rm them. You have told git that you wish to copy the files into the subdirectory. Once you git rm them, the output of git status will tell you that git wants to move the files into the subdirectory.

    A shortcut is git add -u, which informs git of files which have been modified or removed. It will not add new files, though. If you rename files, the easiest way to inform git is with git add -A, which looks at modified, removed, and untracked files. It will remove your four removed files and add the .DS_Store file.

    The best way to hide the .DS_Store file is to globally ignore it:

    git config --global core.excludesfile '~/.gitignore'
    echo .DS_Store >> ~/.gitignore
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I accidentally added a local directory to my local Git repo. git add dirName
After git init , I added and committed a few files, made some changes,
I dragged in a folder containing a few files and copied them into the
I've been using git for a few months and have never run into problems.
We have added few folders/files in TFS which was deleted later. But, this folders
I accidentally added a few files to my working copy directory, and when I
I'm using Google Maps' API and added a few markers in a map. Each
I have a few custom UITableViewCells - http://img11.imageshack.us/i/customfacilitiescell.png/ which are added to this UIViewController
Up until today I was using git in the following manner: a master repo
I added few files to svn repository. But before I do commit, I deleted

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.