tags:

views:

345

answers:

4

I get git-status at ~/bin:

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

I run

git add --force screen/dev/

I get the same git-status as before. I add each file in the folder independently, but I get the same git-status.

There is no .git in screen/dev/. The folder seems not to be a sumbodule.

How can you add a folder and its content with force to my git at ~/bin?

+1  A: 

Is that a typo on cut paste?

If not, it should be

git add --force screen/dev
Tyrone Slothrop
Thank you for pointing that out! -- I fixed it in the post.
Masi
+2  A: 

You should not need '--force' or '-f' option: see git add:

-f
--force:

Allow adding otherwise ignored files.

In your case, you may not want to add all files, included ignored files under screen/dev directory.

 git add screen/dev

should be enough (without options or ending '/')

VonC
The same problem occurs also without `/`.
Masi
+1  A: 

Try doing:

git add -A .

Also, if you have a .gitignore file it's also possible that you are unintentionally ignoring something (ie: possibly the files you are trying to add).

Fake Code Monkey Rashid
The same problem occurs also after running your command. I do not have the folder at the .gitignore -files.
Masi
A: 

The problem can be solved by renaming the folder and adding the folder with a new name to Git.

This suggests me that there must be some file manipulating the folder name dev.

Masi