1

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

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

enter image description here

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!

Ulli H
  • 1,748
  • 1
  • 19
  • 32

2 Answers2

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
Em L
  • 328
  • 1
  • 7
  • when using the git push - u origin master i get the errors error: src refspec master does not match any. error: failed to push some refs to 'git@github.com:UlliH/UHCoreData.git' – Ulli H Jul 24 '16 at 13:28
  • see [src refspec master does not match any when pushing commits in git](http://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git) – Em L Jul 24 '16 at 13:59
  • "nothing added to commit but untracked files present"? I´m helpless... :-( – Ulli H Jul 24 '16 at 14:05
  • git remote -v tells origin git@github.com:UlliH/UHCoreData.git (fetch) origin git@github.com:UlliH/UHCoreData.git (push) – Ulli H Jul 24 '16 at 14:43
  • Have your local directory already add to repository? `git add .` – Em L Jul 24 '16 at 14:53
  • no, i didn´t know, that i must do that :-( Its wasting a long time... I´ll be back afterwards... – Ulli H Jul 24 '16 at 14:57
  • Ok, i repeat it all and after _git push -u origin master_ i got the message **Branch master set up to track remote branch master from origin. Everything up-to-date**. But i can´t see a resul. BTW Thanks a lot until here... – Ulli H Jul 24 '16 at 15:54
  • Do you run `git commit -m "xxx"`? `git status` see your current branch status – Em L Jul 25 '16 at 01:52
0

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

enter image description here

maybe it will help someone...

Ulli H
  • 1,748
  • 1
  • 19
  • 32