From f4382617f8b050f38dc2ebcb9a436aa8809dba6e Mon Sep 17 00:00:00 2001
From: Brandon Rodriguez <brodriguez8774@gmail.com>
Date: Wed, 4 Dec 2019 01:36:56 -0500
Subject: [PATCH] Create git_submodules document file

---
 documents/git_submodules.md | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 documents/git_submodules.md

diff --git a/documents/git_submodules.md b/documents/git_submodules.md
new file mode 100644
index 0000000..36f52c2
--- /dev/null
+++ b/documents/git_submodules.md
@@ -0,0 +1,30 @@
+# Graph Library > Documents > Git Submodules.md
+
+
+## Git Submodules
+This project should be used as a "git submodule". Git submodules are essentially projects that are meant to be used
+within other projects.
+
+### Installing Submodules
+Submodules can be imported into another project with the command:
+* ``git submodule add <project_url> <location_to_store_submodule>``<br><br>
+Where:
+    * `<project_url>` is the same as if you were to run `git clone` to pull the project.
+    * `<location_to_store_submodule>` is the location you wish the submodule to store within the parent project.
+
+### Initializing Submodules
+When you clone a repo that uses submodules, you'll need to initialize the submodules before they can be accessed. This
+can be done in one of two ways:
+* Add the `--recursive` tag when you clone the parent project. This will also get all submodules (assuming they're
+defined within the master branch).<br><br>
+Ex: `git clone --recursive <project_url>`<br>
+
+* If the original project was already cloned, or if the submodule wasn't in the master branch, use:<br><br>
+`git submodule update --init --recursive`
+
+### Updating Submodules
+Any projects that use a submodule will automatically track which commit is being used. When a submodule is updated, the
+projects using them will have to update which commit they point to.<br><br>
+This is accomplished with 2 steps:
+* ``git submodule foreach git pull origin master``
+* Verify the pulled submodule changes are what you want, and commit them.
-- 
GitLab