I am trying to add a whole directory into github. Below are the codes I am using to do that. the commit and push doesn't show anything new because I repeated the process to paste here; but those are commands I followed.
It adds the directory but I can not access the files inside. It looks like below.
Is there any easier way to add the sub directory? Is there any easier way to move repositories inside github?
The folder image next to the
Machine-Learning-Tutorials
line in github suggests that you're adding a sub-module to an existing repository. That seems to be supported by the fact that you do agit init
, but don't add a remote.I'm guessing that
~/Documents/Merge/Git/Github/
is a git repository tracking github? If that's the case you don't need to do thegit init
--you already have a repository--and right now you'll actually want to remove the~/Documents/Merge/Git/Github/Tutorials/.git
directory. At that point if you do agit add Tutorials
it should add the actual files and let you push them up to github.If you have a repository and you just want to add more files (in the current directory or a subdirectory) you just need to use
git add
, there's no need togit init
a directory unless you want to track it as a separate repository (known as a submodule).