I'm working through the Rails Tutorial. Anyone know how to add a directory in GitHub?
see section 1.3.4 http://railstutorial.org/book?version=2.3#sec:version_control
I can only get my README file and not the whole directory
I'm working through the Rails Tutorial. Anyone know how to add a directory in GitHub?
see section 1.3.4 http://railstutorial.org/book?version=2.3#sec:version_control
I can only get my README file and not the whole directory
To add a directory to your Git repository, you should create at least one file in it. Git doesn't like empty directories in repositories.
I think the git -add .
is misleading. To add new directories I usually have to issue git add -A
. Checkout information about the commands you use by issuing git add --help
. That should usually open a web site with more info.
I say usually because on my machine it doesn't work right now (WTF @#"!)
You can't add an empty directory to a git repository. Git manages files.
So if you want to have a directory be effectively added to your git repository, you need to add a file to it.
What most people do is to create empty files called .gitkeep
Just create the file and commit it.
touch tmp/.gitkeep
git add tmp/
git commit -m "we always want the tmp dir"