0

I have a school exercise about github. This is the first exercise and i have a problem. We should clone a folder first, and i did it right, then we should make "web app" with this instructions https://github.com/jce-il-ex/angular2-first-time-benhuri. in this URL you can see i have the folder "my-app" but i can't really reach it because its grey. I tried to read everything here and in web about grey folder, but i can't fix it. I don't know what to do... It's almost 4 hours since i tried everything.

I will really appreciate any help from you. Thanks.

Ben Huri
  • 13
  • 4
  • Possible duplicate of [What does a grey icon in remote GitHub mean](http://stackoverflow.com/questions/19584255/what-does-a-grey-icon-in-remote-github-mean) – Schwern Mar 03 '17 at 17:02

1 Answers1

2

I dug through your commit history and I'm guessing because you didn't use real commit messages that you created a git submodule called my-app but didn't check in the .gitmodules part which says where that submodule is to be found.

When a project that uses submodules is cloned, the submodules will appear as an empty directory. Github is showing that empty directory as greyed out. You have to explicitly init and update the submodule with git submodule init and git submodule update. But your repository is lacking its .gitmodules file which says where the submodule is located.

You can read more about how this works in the Pro Git chapter on Submodules, but I'd recommend you stay away from submodules until you learn Git basics... like writing informative commit messages. :P

Schwern
  • 153,029
  • 25
  • 195
  • 336
  • 1
    I admire the dedication to look through the commit history. – Jhecht Mar 03 '17 at 17:05
  • @Jhecht It's like doing archeology in the UK. Even if you don't find what you're looking for, you'll always dig up something interesting. – Schwern Mar 03 '17 at 17:07
  • Well i'm still new so i don't really know what all of those things mean.. So where is no way to solve it? cause the other people in my class did it without any problem, i just had no luck i guess. – Ben Huri Mar 03 '17 at 17:10
  • @BenHuri Read the chapter in the Pro Git book. Follow its instructions. Like I said, you forgot to check in the `.gitmodules` created when you did a `git submodule add`. I'm guessing from your commit log you did that on a different machine, didn't commit `.gitmodules`, went home and cloned the repo, found `git submodule init` didn't work, deleted `my-app`, did `git submodule add` again, and again forgot to commit `.gitmodules`. It works because `.gitmodules` is still sitting in your directory, but it never got committed and uploaded to Github. – Schwern Mar 03 '17 at 17:14
  • then i get this... The following path is ignored by one of your .gitignore files: my-app/angular2-first-time-benhuri Use -f if you really want to add it. Is there any way just to delete everything and start from the beining? :\ – Ben Huri Mar 03 '17 at 17:28
  • @BenHuri Yes, you can delete everything and start from the beginning by deleting everything and starting from the beginning. :) Locally, you'd delete the directory. On GitHub, there's an option to delete the repository in the admin panel. But you can also edit your `.gitignore` file which also wasn't checked in and should be. – Schwern Mar 03 '17 at 18:25
  • @BenHuri It should be just a file in the repository, .gitignore. Because it has a dot in front of it, it's possible your operating system is hiding it from you. – Schwern Mar 03 '17 at 18:55
  • @Schwern I deleted it locally but i still see it in my github ,and i can't really delete it from there... (I have no setting option which alowed me to remove repository). – Ben Huri Mar 04 '17 at 08:51
  • @BenHuri I see, you're not the owner of the repo on Github so you can't delete it. What I don't see is a `.gitignore` on Github, so once you've deleted it locally you should be fine. This may help: one of the things about Git is it does not talk to the remote (ie. Github) until you tell it to. You have a complete copy of the repository on your disk and that's what you're working with. In a lot of ways, that's all you have to worry about. Forget about Github and just fix it locally; it simplifies things a lot. Then you can `git push` the result to Github when you're ready. – Schwern Mar 04 '17 at 21:59