Reputation: 33
I am trying to add an existing Java project from a workspace to my git repository.
I'm using git version 1.8.3.2 on Linux.
I use this command:
git init/committed/remote origin/pushed
However, the src directory is only appearing as a greyed out empty folder.
How do I add a folder with subfolders to my github repository?
This is what it looks like. Notice 'src' is greyed out and un-clickable.
Upvotes: 3
Views: 9597
Reputation: 1780
You should follow this guide: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
Upvotes: 0
Reputation: 72547
src
and bin
are git submodules
. They're not browsable because they are only pointers to other git repositories - they're not really "folders".
To add everything in a directory and subdirectories to git in one command, you can use git add .
, which recursively adds.
Section 6 of the Pro Git book explains what a submodule is.
Assuming you do not want submodules, you can fix your repository like this:
cd <project> # Go to the projects root
rm -rf .git # Remove all git information (keeping your code).
cd src # and repeat for src and bin
rm -rf .git
cd ../bin
rm -rf .git
cd .. # now, back in the projects root
git init # Make a git repository
git add . # Add everything to it
git commit -m 'Initial commit'
git remote add github <github-url>
git push -f github # Force push to github, to overwrite everything we had before.
src
and bin
!!I'm pretty sure this is what you want to do.
Upvotes: 3
Reputation: 1191
To add *.*
files and folders do it as follow:
git init
git add .
git commit -m "This is my commit"
git push origin master
BTW: you can find more simplified details in the following tutorial: Import an existing, unversioned code project to an empty repository
Upvotes: 0