0

I have a directory lessons, then under it subdirectories 20200110, 20200111, 20200112 etc. Each of the subdirectories contain lesson files. I want this directory structure on my github site just like it is on my computer. How can I do this? When I do git init inside, say, 20200110, add, commit, etc., the next step is to do git remote add origin remote repository URL, however, I can't figure out what that remote repository URL is supposed to be. What am I missing? Again, I need to do this for each day's lessons.

147pm
  • 2,137
  • 18
  • 28

2 Answers2

0

Login into github, create your empty repo on https://github.com/new, and then you can see the guidelines to push the directories into repo URL.

Santhosh V
  • 380
  • 1
  • 11
0

Git tracks only files not directories. Directories are only added to complete paths to files they contain. That is, directories 20200110, 20200111 and 20200112 inside your git repository lessons will each be tracked as soon as it contains a file. It's not really a directory being tracked but a file inside. You may check the link How can I add an empty directory to a Git repository?.

sasiplusplus
  • 21
  • 1
  • 5
  • Actually, when I created `lessons/20200110/file1.txt` the offered clone URL was only `.../lessons/` and not `.../lessons/20200110`. – 147pm Jan 29 '20 at 16:29
  • what is the output of your `git status`? – sasiplusplus Jan 30 '20 at 19:31
  • Well, the clone `url` only reflects the repository name not its directory structure. Check if you are cloning the right branch in case you have multiple branches and you changes happen to be in a non-default branch. You may try `git clone --branch ` to clone a specific branch. Alternatively you may try merging your branch into default branch (master by default) which git clones if no `--branch` option is specified. – sasiplusplus Jan 30 '20 at 20:11