I'm using Github Pages to host a user webpage and a Jekyll Now project webpage. Because of the way Github Pages assigns web addresses, the user webpage is located at username.github.io, while the project is assigned to username.github.io/blog.
I want the blog project to be able to access some files from the user webpage, such as styles.css. In order to facilitate relative file paths, I thought it would be a good idea to locally nest my blog project within my user webpage directory; that way the relative paths would be the same both on the web and on my local machine, meaning that the path "../styles.css" would let my blog project access the user webpage's CSS in all contexts.
To nest the projects, I simply made a local clone of the blog project within the local user webpage repository. Conveniently, the Github user webpage repository immediately recognized this /blog directory as a submodule. I've been doing some research and some tests to make sure that this arrangement results in the behavior I want, and so far everything has been perfect except for one confusing footnote.
I made a change within my local submodule and pushed it. Then without making any other changes, I staged, committed, and pushed my superproject repository using the following:
git add .
git commit -m "just a test"
git push origin master
I expected the push to fail because I hadn't actually made any changes in the superproject — the only change had been in the submodule. However, to my surprise the push worked.
When I analyzed the commit on Github, it showed a single change to the blog folder described as follows:
Submodule blog updated from 632f0e to e6a35d
My question: Did this push do anything that would functionally affect the way my projects/website works? Or is it just scribbling a comment that's only purpose is to be read by humans?
At this point I haven't found any functional differences, but I'm still new to Github, want to understand how things work, and am concerned that this might cause undesired behavior down the line.
It might be worth noting that I don't foresee this superproject depending on the submodule - rather, the submodule will depend on the superproject to get some of its styling.
Results that did not answer this question (perhaps because the questions were more complex than I could understand):
- Update a submodule to the latest commit
- Git submodule - How to keep the submodule updated when pulling from the main repo
- (there are more but apparently I can't post them without more reputation)