GitHub: how to add Subfolders to a GitHub-Repository

萝らか妹 提交于 2019-12-12 01:58:24

问题


I´m very new in GitHub (since yesterday ;-)) and want to add files & folders

In my Xcode-Project i have this Folder-/File-Structure:

entries with the folder-icon as CodeDataTest, Classes, Model,... are Folders, the rest are files. Now i want to add these structure to my new GitHub-Repository as shown.

I googled a lot but found no solution. :-(

Can you help me?

Thanks in advance!


回答1:


1.Login GitHub, then click Start a Project -> Create a new repository, input your name CoreDataTest

2.Run git init in your local CoreDataTest directory.

3.Run the following command:

git remote add origin git@github.com:xxxx/CoreDataTest.git

4.Finally, push local repository to remote

git push -u origin master



回答2:


I got it after wasting a lot of time...

In the accepted answer of Em L everything was correct, but me idiot added at github.com a new repository with adding a new README.md and this caused the error

 ERROR: Repository not found.
 fatal: Could not read from remote repository.
 Please make sure you have the correct access rights

after a lot of tries, i added a new repository without a new README.md and everything was ok, but i don´t know the reason. :-( Till yesterday, when on a new try i finally noticed it...

So my solution in addition to Em L answer is

maybe it will help someone...



来源:https://stackoverflow.com/questions/38546077/github-how-to-add-subfolders-to-a-github-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!