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?
The proper way would have been to use
git mvto move the files into the directory; as it stands you can simplygit rmthem. You have told git that you wish to copy the files into the subdirectory. Once yougit rmthem, the output ofgit statuswill 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 withgit 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_Storefile is to globally ignore it: