-3

I have cloned a repo on my local PC, and I wish to create a directory structure within the local repo.

Do I just create a directory, then push the change back to the remote, or is there a specific process?

jcm
  • 1,781
  • 1
  • 15
  • 27
GitNewbie
  • 41
  • 1
  • 3
  • 1
    Git doesn't track directories – only files (and their paths). – Will Vousden Mar 26 '15 at 14:12
  • 1
    possible duplicate of [How can I add an empty directory to a Git repository?](http://stackoverflow.com/questions/115983/how-can-i-add-an-empty-directory-to-a-git-repository) – nwinkler Mar 26 '15 at 14:27

1 Answers1

5

Git does not track directories; it will just implicitly create a directory when you create a file inside the directory. If you want to commit an empty directory, the convention is to create a file named .gitkeep inside it.

Then just git add that file, git commit and git push as normal.

Thomas
  • 174,939
  • 50
  • 355
  • 478