1

First, I go into GitHub and click Create Repository, name the repository KMtoMiles and click create repository (I am not creating a read me or anything like that)

Then, I do these steps from the command line:

echo "# KMtoMiles" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Gl4di4torRr/KMtoMiles.git
git push -u origin master

So now the README.md file is pushed to my repo.

Now I do

git add .
git commit -m "initial commit"
git push -u origin master

Now I have pushed all of my app onto GitHub.

However, when I go to GitHub, I see that my www directory is greyed out.

GitHub directory

So I am a GitHub noob. I have tried to do the steps here

But I can't get the whole .gitmodule thing or whatever to work for me. I have tried doing stuff like:

git submodule update --init
git submodule add <url> <directory>

But no luck.

I have also researched Ionic's documents for an intro to GitHub or something like that.

Community
  • 1
  • 1
Chris Bolton
  • 2,162
  • 4
  • 36
  • 75

1 Answers1

1

First, you must create two repos: KMtoMiles-root and KMtoMiles.

The submodule to Gl4di4torRr/KMtoMiles is in your other repo Gl4di4torRr/KMtoMiles-root.

That means a git clone --recursive https://github.com/Gl4di4torRr/KMtoMiles-root will:

  • clone KMtoMiles-root
  • and update KMtoMiles-root/www at the same time.

But on GitHub itself, that www folder will always remains gray and empty: it represents a pointer (a gitlink, special entry in the index, referencing a SHA1 of Gl4di4torRr/KMtoMiles).

Ionic GitHub Example:

For future reference on how to configure a submodule, you can use this example to configure your .gitignore and .gitsubmodule.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250