Repository navigation
Local TM Environment Setup
- Clone main TM repo to your local environment
- Run setup scripts
- Create your development branches in the main TM repo
- Create your development branches in a submodule
- Push your changes to GitHub
- Keep your working copies in sync
- Process Diagrams
~/GitRepo/WebstormProjects/tekgirl77
$ git clone git@github.com:TeamMentor/TM.git
Cloning into 'TM'...
remote: Counting objects: 256, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 256 (delta 17), reused 0 (delta 0), pack-reused 214
Receiving objects: 100% (256/256), 28.14 KiB | 0 bytes/s, done.
Resolving deltas: 100% (123/123), done.
Checking connectivity... done.-
This will be our main repo which contains all of the submodules:
$ cd TM -
The npm_install.sh script will initialize and fetch all submodule repos, as well as run node package manager (npm) install on them to ensure all dependencies are installed and registered with node.
$ cat npm_install.sh #!/usr/bin/env bash git submodule init git submodule update cd code function npm_Install() { echo Running npm install on folder: $1 cd $1 npm install cd .. } npm_Install TM_GraphDB npm_Install TM_Shared npm_Install TM_Website cd ../build npm_Install TM_4_0_JSON_Data
-
Here is a snippet of the typical stdout when running the npm_install.sh script:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ bin/npm_install.sh Submodule 'TM_4_0_JSON_Data' (git@github.com:TeamMentor/TM_4_0_JSON_Data.git) registered for path 'build/TM_4_0_JSON_Data' Submodule 'code/TM_4_Flare' (git@github.com:TeamMentor/TM_Flare.git) registered for path 'code/TM_Flare' Submodule 'TM_4_0_GraphDB' (git@github.com:TeamMentor/TM_GraphDB.git) registered for path 'code/TM_GraphDB' Submodule 'code/TM_4_Jade' (git@github.com:TeamMentor/TM_Jade.git) registered for path 'code/TM_Jade' Submodule 'code/TM_Shared' (git@github.com:TeamMentor/TM_Shared.git) registered for path 'code/TM_Shared' Submodule 'code/TM_4_Static' (git@github.com:TeamMentor/TM_Static.git) registered for path 'code/TM_Static' Submodule 'code/TM_Website' (git@github.com:TeamMentor/TM_Website.git) registered for path 'code/TM_Website' Submodule 'config/SiteData_TM_4' (git@github.com:TMClients/SiteData_TM.git) registered for path 'config/SiteData_TM' Submodule 'Lib_Docs-json' (git@github.com:TMContent/Lib_Docs-json.git) registered for path 'data/Lib_Docs-json' Submodule 'Lib_UNO' (git@github.com:TMContent/Lib_UNO.git) registered for path 'data/Lib_UNO' Submodule 'Lib_UNO-json' (git@github.com:TMContent/Lib_UNO-json.git) registered for path 'data/Lib_UNO-json' Submodule 'TM_QA' (git@github.com:TeamMentor/TM_QA.git) registered for path 'qa/TM_QA' Cloning into 'build/TM_4_0_JSON_Data'... remote: Counting objects: 210, done. remote: Total 210 (delta 0), reused 0 (delta 0), pack-reused 210 Receiving objects: 100% (210/210), 33.43 KiB | 2.00 KiB/s, done. Resolving deltas: 100% (107/107), done. Checking connectivity... done. Submodule path 'build/TM_4_0_JSON_Data': checked out '8da9592ead888edd53fb4032a5dd7bb8c9e59436' Cloning into 'code/TM_Flare'... remote: Counting objects: 64, done. remote: Total 64 (delta 0), reused 0 (delta 0), pack-reused 64 Receiving objects: 100% (64/64), 13.14 KiB | 0 bytes/s, done. Resolving deltas: 100% (31/31), done. Checking connectivity... done. Submodule path 'code/TM_Flare': checked out '6c6bdc6c9f93baf0a93114021303e96897a7031f' ... ```
-
-
First, let's checkout the Dev branch within our main TM repo. We are going to use the --track parameter upon our first checkout of this branch, to make sure our new local Dev branch is tracking to it's remote counterpart:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git checkout --track remotes/origin/Dev M code/TM_Flare M code/TM_GraphDB M code/TM_Jade M code/TM_Static M code/TM_Website M config/SiteData_TM M qa/TM_QA Branch Dev set up to track remote branch Dev from origin. Switched to a new branch 'Dev'
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Dev Your branch is up-to-date with 'origin/Dev'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: code/TM_Flare (new commits) modified: code/TM_GraphDB (new commits) modified: code/TM_Jade (new commits) modified: code/TM_Static (new commits) modified: code/TM_Website (new commits) modified: config/SiteData_TM (new commits) modified: qa/TM_QA (new commits) no changes added to commit (use "git add" and/or "git commit -a")
-
You can see the submodules need to be updated to be in sync with the Dev branch that we are now on. You will read a bit more detail on this in the section below about keeping your working copies in sync
-
For now, we will simply run the git submodule update command to sync them up:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule update --recursive Submodule path 'code/TM_Flare': checked out 'a7d98d7b0164f183c4a745459e77bbbe5e9d73b4' Submodule path 'code/TM_GraphDB': checked out 'c1191396c5e77ee50e9f5732795eabcfed9c26a5' Submodule path 'code/TM_Jade': checked out '5f11fac01ef4b011bf45211d1a73866e6e809fd3' Submodule path 'code/TM_Static': checked out 'bd6eef45c1c05304daa4c02246147ca911ade13e' Submodule path 'code/TM_Website': checked out 'ae391be43a08838fcb35da4d4ee9a0631053fb2d' Submodule path 'config/SiteData_TM': checked out '5a2fe18c6924b2ee2d8777750acb3207742f76ea' Submodule path 'qa/TM_QA': checked out 'ed430a55532098403c0cc7c4b638554c71030883' ``` ```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Dev Your branch is up-to-date with 'origin/Dev'. nothing to commit, working directory clean ```
-
-
If you are going to do work in the main TM repo, then your next step would be to create an Issue_[nn]_[description] branch here:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git checkout -b Issue_100_some_description_here Switched to a new branch 'Issue_100_some_description_here'
-
The git branch command now shows all of our branches we have either cloned or created locally so far:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git branch Dev * Issue_100_some_description_here master- You can list all local and remote branches on the main repo or any submodule by using the *-a* switch. To show what commit they are at, add the *-v* switch as well. Notice the branches we just created (**Dev** and **Issue_[nn]_[description]**) are all in sync, at the same commit: ```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git branch -av Dev cb8d439 updating gulp and angular * Issue_100_some_description_here cb8d439 updating gulp and angular master 203a993 Merge pull request #11 from TeamMentor/Issue_880_882-take2 remotes/origin/CR.Beta.11 6165d13 updating master with fix for #864 remotes/origin/Dev cb8d439 updating gulp and angular remotes/origin/HEAD -> origin/master remotes/origin/Issue_618_Flare_Wired 1432a7a updated commits for TM_Flare and TM_Website remotes/origin/Issue_859_Config_Refactor 17036bb updated to latest commit remotes/origin/Issue_879 8f0ae0b Fixing tabbing remotes/origin/Issue_880_882-take2 4841d8f Fixing issue 880 and 882 - removing Librarie submodules frommaster remotes/origin/Issue_884 a97de02 Fixing issue 884 remotes/origin/Issue_887 3ba8ab2 add latest Beta json files remotes/origin/master 203a993 Merge pull request #11 from TeamMentor/Issue_880_882-take2 ```
-
-
To view the relative path to all submodules including their current status, from our main /TM repo use the git submodule status --recursive command; the --recursive parameter will make sure any sub-sub-modules are also displayed, if there are any:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule status --recursive 81f25abf3b1eda8ee63671e8f5fb527beb1778ce build/TM_4_0_JSON_Data (heads/master) -a4d29804d7f3a3d4e794d4bbd411ee1f6a8fa037 build/TM_Gulp -edceaedc586957cf1626129cf4b978b9fdfede7e code/TM_Angular 9df54e393b6b438af61f8e6dbfa06781b785b465 code/TM_Flare (heads/Dev) c1191396c5e77ee50e9f5732795eabcfed9c26a5 code/TM_GraphDB (4.0.1-7-gc119139) 60eb58af5e47142b4461cc138dff97d2139c966d code/TM_Jade (remotes/origin/Dev) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) f0189de04d4e6c598a0e6023df7763e5be722ca9 code/TM_Static (f0189de) 42d147514d20edea677e4e9209a36715f707ba62 code/TM_Website (remotes/origin/Dev) 7104fc7eff7b64a88e23b98fd65fa20cffbd3c9e config/SiteData_TM (remotes/origin/Dev) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) -5aa393b2395255ee5fb0c34f2e665e232867964c data/Lib_UNO -1ce443c15f63e6b153b51e79170d2df17ceda220 data/Lib_UNO-json fc7629f1ce8a9fed4c615d5f8c0e3e4b05935698 qa/TM_QA (4.0.1-17-gfc7629f) -
Navigate to the submodule you would like to work on within your local cloned environment:
$ cd code/TM_Flare -
Checkout the Dev branch, if one exists, in the remote project repository. Remember, since this is the first checkout of a remote branch, we will use the --track parameter to make sure our new local Dev branch is tracking to it's remote counterpart:
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git checkout --track remotes/origin/Dev Branch Dev set up to track remote branch Dev from origin. Switched to a new branch 'Dev'
-
Remember, you can list all local and remote branches on the main repo or any submodule by using the -a switch. To show what commit they are at, add the -v switch. Here you can see both the remote and our local copy of the Dev branch are at the same commit, as expected:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git branch -av * Dev 9df54e3 Merge pull request #7 from TeamMentor/Dev_Lucy master 6c6bdc6 updated links to remove '/static' remotes/origin/Dev 9df54e3 Merge pull request #7 from TeamMentor/Dev_Lucy remotes/origin/Dev_Lucy db089e6 change filters over to checkboxes remotes/origin/HEAD -> origin/master remotes/origin/Issue_618_Flare_Wired 892fda9 wired dynamic content to navigation remotes/origin/Issue_869 6a16688 update templates for layouts #869 remotes/origin/Issue_870 50a0c8d update pages for #870 remotes/origin/Issue_871 81b816a make side navs clickable not hoverable #871 remotes/origin/Issue_876 7a60112 start going through pages and checking everything in safari #876 remotes/origin/master 6c6bdc6 updated links to remove '/static' ``` -
To verify which branches are tracking to which remote branches, you can use the git remote show origin command:
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git remote show origin * remote origin Fetch URL: git@github.com:TeamMentor/TM_Flare.git Push URL: git@github.com:TeamMentor/TM_Flare.git HEAD branch: master Remote branches: Dev tracked Dev_Lucy tracked Issue_618_Flare_Wired tracked Issue_869 tracked Issue_870 tracked Issue_871 tracked Issue_876 tracked master tracked Local branches configured for 'git pull': Dev merges with remote Dev master merges with remote master Local refs configured for 'git push': Dev pushes to Dev (up to date) master pushes to master (up to date)
-
-
Next create your Issue_[nn]_[description] branch:
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git checkout -b Issue_99_some_issue_description Switched to a new branch 'Issue_99_some_issue_description'
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git branch Dev * Issue_99_some_issue_description master
-
Now that you have modified some content in a submodule, you can review and commit your changes.
-
For the purposes of our example, we have simply added a line to the README.md file using VI:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ vim README.md ``` ```bash ~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git status On branch Issue_99_some_description_here Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: README.md no changes added to commit (use "git add" and/or "git commit -a") ```
-
-
Use the git diff command to view and compare a summary of all changes within the submodule:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git diff diff --git a/README.md b/README.md index 9df54e3..57621dc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # TM_4_Flare Repo to hold TM 4.x Flare files + ``` -
Once you have reviewed and are satisfied with your changes, let's commit them:
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git commit -am "Testing git workflow with submodules" [Issue_99_some_description_here 57621dc] Testing git workflow with submodules 1 file changed, 1 insertion(+)
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git status On branch Issue_99_some_description_here nothing to commit, working directory clean -
Once committed, push your changes as normal. You can verify configured origin and upstream repositories using the -v switch:
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git remote -v origin git@github.com:TeamMentor/TM_Flare.git (fetch) origin git@github.com:TeamMentor/TM_Flare.git (push) -
Here we are pushing and naming our new Issue_[nn]_[description] branch to the origin location, which is our remote repository hosted on the GitHub server:
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ git push origin Issue_99_some_description_here:Issue_99_some_description_here Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 328 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) To git@github.com:TeamMentor/TM_Flare.git * [new branch] Issue_99_some_description_here -> Issue_99_some_description_here
-
If you change directories from the submodule back up into the main TM repo, you will notice that it sees the submodule has been modified:
~/GitRepo/WebstormProjects/tekgirl77/TM/code/TM_Flare $ cd ../..
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Issue_100_some_description_here Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: TM_Flare (new commits) no changes added to commit (use "git add" and/or "git commit -a")
-
Running the git diff --submodules command will display your new commit and any associated comment:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git diff --submodule Submodule code/TM_Flare 9df54e3..57621dc: > Testing github workflow
-
Running the git diff command will display the entire commit hashes:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git diff diff --git a/code/TM_Flare b/code/TM_Flare index 9df54e3..57621dc 160000 --- a/code/TM_Flare +++ b/code/TM_Flare @@ -1 +1 @@ -Subproject commit 9df54e393b6b438af61f8e6dbfa06781b785b465 +Subproject commit 57621dc58d3708c1402ab4faa389741c59b2a5d1 -
Now you can either reset your submodules back to the original commit that was "pinned" to the main TM repo branch you are on, or you can commit the changes you just made again to "pin" them to this branch at the main TM repo level.
-
Since the submodules are only pointers to other repositories, updating your submodules will sync them back up to their previous saved state that was "pinned" to the branch you are on in the main repo:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule update Submodule path 'TM_Flare': checked out '9df54e393b6b438af61f8e6dbfa06781b785b465'
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Issue_100_some_description_here nothing to commit, working directory clean -
If you are working on multiple submodules or would like the changes you just commited on the submodule to be "pinned" to the main TM repo branch you have checked out, then you can commit your branch at the main TM Repo level.
-
In our case we are on Issue_100_some_description_here on the main TM repo. Once we commit at the main TM repo level, we will be "pinning" these submodule changes to our TM repo branch:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git commit -am "Pinning TM_Flare at commit 57621d" [Issue_100_some_description_here d3cbb7f] Pinning TM_Flare at commit 57621d 1 file changed, 1 insertion(+), 1 deletion(-)
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Issue_100_some_description_here nothing to commit, working directory clean -
Now, each time we check our Issue_100_some_description_here branch out on the main TM repo and run a git submodule update command, this submodule will be at this "pinned" commit:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git checkout Issue_100_some_description_here M code/TM_Flare Switched to branch 'Issue_100_some_description_here'
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Issue_100_some_description_here Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: code/TM_Flare (new commits) no changes added to commit (use "git add" and/or "git commit -a")
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule update Submodule path 'code/TM_Flare': checked out '57621dc58d3708c1402ab4faa389741c59b2a5d1'
-
-
-
Remember, to verify which branches are tracking to which remote branches, you can use the git remote show origin command:
$ git remote show origin * remote origin Fetch URL: git@github.com:TeamMentor/TM.git Push URL: git@github.com:TeamMentor/TM.git HEAD branch: master Remote branches: CR.Beta.11 tracked Dev tracked Issue_618_Flare_Wired tracked Issue_859_Config_Refactor tracked master tracked Local branches configured for 'git pull': Dev merges with remote Dev master merges with remote master Local refs configured for 'git push': Dev pushes to Dev (up to date) master pushes to master (up to date)
-
First we will make sure we have the Dev branch checked out in our main TM repo so we can sync up with any changes on our remote origin/Dev GitHub repo:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git checkout Dev M code/TM_Flare M code/TM_Jade M code/TM_Website Switched to branch 'Dev' Your branch is up-to-date with 'origin/Dev'.
-
You can see the submodules need to be synced up with our local Dev branch as well. Since we were on the master branch, we were working with a different set of submodule branches and commits. Now that we have checked out the Dev TM branch, the submodules need to be updated so that the corresponding commits are checked out.
-
Here is the submodule status before running the git submodule update to sync them up with our TM Dev branch. These are the commits that were "pinned" to our master branch we were previously on:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule status 00be9cd41f5d101f0d9b57828e829b5e505022e4 build/TM_4_0_JSON_Data (heads/master) 6c6bdc6c9f93baf0a93114021303e96897a7031f code/TM_Flare (heads/master) ba706ca08deb96c09e2a8ed2f71a858e6ddddb30 code/TM_GraphDB (4.0.1-4-gba706ca) d9f8b149b0715d184e4940a1f66cf60576ccf145 code/TM_Jade (heads/master) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) 7baed52cbbec13aa203c7cc993c91ffc23092a57 code/TM_Static (heads/master) 2a32e72f0c98d289441a05fd0f0adacaaca7c2ca code/TM_Website (CR.Beta.11-2-g2a32e72) be6b8dc7910b03b0633ff5f58c11f7e6009e3787 config/SiteData_TM (heads/master) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) 62511d89212260ae02ee183ff22b1dfc15ec8756 data/Lib_UNO (heads/master) c10d4b6bc634f151820e2264ca98eee46b57fa28 data/Lib_UNO-json (heads/master) f419718b9822a7d09d099f8f0c2595f1598cefab qa/TM_QA (4.0.1-6-gf419718) ``` -
Here we will run our command to sync back up. Notice the submodules are checking out the latest commits that are "pinned" to our TM Dev branch:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule update Submodule path 'code/TM_Flare': checked out 'b5eaf460284771ebff43b932f3f34eb20824e053' Submodule path 'code/TM_Jade': checked out '5f11fac01ef4b011bf45211d1a73866e6e809fd3' Submodule path 'code/TM_Website': checked out '1e3032d1d4bfb93f23a7ddae5052312a88508690' ``` -
Here is the updated git status now showing that we are in sync and nothing appears to be modified on our Dev branch or in any of the submodules yet:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Dev Your branch is up-to-date with 'origin/Dev'. nothing to commit, working directory clean ``` -
And here is the updated git submodule status. Notice the three submodules that were updated previously for our Dev branch are now showing these updated commits and branch names:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule 00be9cd41f5d101f0d9b57828e829b5e505022e4 build/TM_4_0_JSON_Data (heads/master) b5eaf460284771ebff43b932f3f34eb20824e053 code/TM_Flare (heads/Dev) ba706ca08deb96c09e2a8ed2f71a858e6ddddb30 code/TM_GraphDB (4.0.1-4-gba706ca) 5f11fac01ef4b011bf45211d1a73866e6e809fd3 code/TM_Jade (heads/Dev) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) 7baed52cbbec13aa203c7cc993c91ffc23092a57 code/TM_Static (heads/master) 1e3032d1d4bfb93f23a7ddae5052312a88508690 code/TM_Website (CR.Beta.11) be6b8dc7910b03b0633ff5f58c11f7e6009e3787 config/SiteData_TM (heads/master) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) 62511d89212260ae02ee183ff22b1dfc15ec8756 data/Lib_UNO (heads/master) c10d4b6bc634f151820e2264ca98eee46b57fa28 data/Lib_UNO-json (heads/master) f419718b9822a7d09d099f8f0c2595f1598cefab qa/TM_QA (4.0.1-6-gf419718) ```
-
-
Next, we will do a git pull to fetch and automatically merge any remote changes into our local working directory:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git pull origin Dev remote: Counting objects: 41, done. remote: Compressing objects: 100% (23/23), done. remote: Total 41 (delta 18), reused 7 (delta 7), pack-reused 9 Unpacking objects: 100% (41/41), done. From github.com:TeamMentor/TM * branch Dev -> FETCH_HEAD 1a6592a..733bd65 Dev -> origin/Dev Fetching submodule build/TM_4_0_JSON_Data remote: Counting objects: 8, done. remote: Total 8 (delta 7), reused 7 (delta 7), pack-reused 1 Unpacking objects: 100% (8/8), done. From github.com:TeamMentor/TM_4_0_JSON_Data 81f25ab..4cc3a0c master -> origin/master Fetching submodule code/TM_Flare remote: Counting objects: 141, done. remote: Compressing objects: 100% (137/137), done. remote: Total 141 (delta 73), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (141/141), 22.19 KiB | 0 bytes/s, done. Resolving deltas: 100% (73/73), done. From github.com:TeamMentor/TM_Flare 36a7874..424fa1a Dev -> origin/Dev ff81a53..74c3c0e Dev_Lucy -> origin/Dev_Lucy * [new branch] Issue_874 -> origin/Issue_874 Fetching submodule code/TM_Jade remote: Counting objects: 2, done. remote: Compressing objects: 100% (2/2), done. remote: Total 2 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (2/2), done. From github.com:TeamMentor/TM_Jade a2bde33..1cd31f4 Dev -> origin/Dev Fetching submodule code/TM_Static remote: Counting objects: 116, done. remote: Compressing objects: 100% (112/112), done. remote: Total 116 (delta 54), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (116/116), 46.37 KiB | 0 bytes/s, done. Resolving deltas: 100% (54/54), done. From github.com:TeamMentor/TM_Static 4c3d139..a7a74de Dev -> origin/Dev 617af3a..6732138 Dev_Lucy -> origin/Dev_Lucy a4cdf68..8b69c01 Issue_721 -> origin/Issue_721 * [new branch] Issue_874 -> origin/Issue_874 Fetching submodule code/TM_Website remote: Counting objects: 20, done. remote: Compressing objects: 100% (19/19), done. remote: Total 20 (delta 6), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (20/20), done. From github.com:TeamMentor/TM_Website f31dc96..51b344e Dev -> origin/Dev Fetching submodule qa/TM_QA remote: Counting objects: 26, done. remote: Compressing objects: 100% (16/16), done. remote: Total 26 (delta 14), reused 5 (delta 5), pack-reused 1 Unpacking objects: 100% (26/26), done. From github.com:TeamMentor/TM_QA d640779..2b2a04b Dev -> origin/Dev 73794eb..314692f master -> origin/master Updating 1a6592a..733bd65 Fast-forward bin/reload_data.bat | 14 +++++++------- build/TM_4_0_JSON_Data | 2 +- build/TM_Gulp | 2 +- code/TM_Angular | 2 +- code/TM_Flare | 2 +- code/TM_Jade | 2 +- code/TM_Static | 2 +- code/TM_Website | 2 +- qa/TM_QA | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) ```-
After the latest merge with our Dev branch, when we run a git status command, we see many submodules were also updated:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Dev Your branch is up-to-date with 'origin/Dev'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: build/TM_4_0_JSON_Data (new commits) modified: code/TM_Flare (new commits) modified: code/TM_Jade (new commits) modified: code/TM_Static (new commits) modified: code/TM_Website (new commits) modified: qa/TM_QA (new commits) no changes added to commit (use "git add" and/or "git commit -a")
-
Running git submodule now will show us the submodule commits that have been modified:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule +81f25abf3b1eda8ee63671e8f5fb527beb1778ce build/TM_4_0_JSON_Data (heads/master) -c8a6eb8b339d7fb598669700251e8ffb2066c341 build/TM_Gulp -1dbfd2bb74a3281595e611e400059724b7f2ba4f code/TM_Angular +36a78740add5d34601153c406d1061d9ae013bdd code/TM_Flare (heads/Dev) c1191396c5e77ee50e9f5732795eabcfed9c26a5 code/TM_GraphDB (4.0.1-7-gc119139) +a2bde331d564430a7783a9ee46712378db598e18 code/TM_Jade (remotes/origin/Dev_Lucy-5-ga2bde33) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) +4c3d1396e47f686642f10d2db8c24a73d7a4210d code/TM_Static (4c3d139) +f31dc9670ea0011bb1a550af36e3d98f481f27a9 code/TM_Website (remotes/origin/Issue_618_Flare_Wired-10-gf31dc96) 7104fc7eff7b64a88e23b98fd65fa20cffbd3c9e config/SiteData_TM (remotes/origin/Dev) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) -5aa393b2395255ee5fb0c34f2e665e232867964c data/Lib_UNO -1ce443c15f63e6b153b51e79170d2df17ceda220 data/Lib_UNO-json +d640779bc5f0aa08df2284769e9be61f2f5c83ef qa/TM_QA (4.0.1-19-gd640779) -
Now, we simply do a git submodule update to resync our submodules back up with our updated TM repo Dev branch:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule update Submodule path 'build/TM_4_0_JSON_Data': checked out '4cc3a0c002fad180f86d32ccab22fc74998c675e' Submodule path 'code/TM_Flare': checked out '424fa1a51321ddec1ab3c0df0bc43a7c907b53fe' Submodule path 'code/TM_Jade': checked out '1cd31f45f130a6cdf92f677710d9dd0e1f7cd8a8' Submodule path 'code/TM_Static': checked out 'a7a74de7618290f8f9d06ef989f4b22f6f4ecd78' Submodule path 'code/TM_Website': checked out '51b344e6faa0b2a4bb2432a988eb78db9b5e8232' Submodule path 'qa/TM_QA': checked out '2b2a04b9a852a2eda9f868b21503badc4eadfb81'
-
But wait, why does our git submodule command still show some of our submodules preceded by a dash and no remote tracking branch displayed?
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule 4cc3a0c002fad180f86d32ccab22fc74998c675e build/TM_4_0_JSON_Data (remotes/origin/HEAD) -c8a6eb8b339d7fb598669700251e8ffb2066c341 build/TM_Gulp -1dbfd2bb74a3281595e611e400059724b7f2ba4f code/TM_Angular 424fa1a51321ddec1ab3c0df0bc43a7c907b53fe code/TM_Flare (remotes/origin/Dev) c1191396c5e77ee50e9f5732795eabcfed9c26a5 code/TM_GraphDB (4.0.1-7-gc119139) 1cd31f45f130a6cdf92f677710d9dd0e1f7cd8a8 code/TM_Jade (remotes/origin/Dev) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) a7a74de7618290f8f9d06ef989f4b22f6f4ecd78 code/TM_Static (remotes/origin/Dev) 51b344e6faa0b2a4bb2432a988eb78db9b5e8232 code/TM_Website (remotes/origin/Dev) 7104fc7eff7b64a88e23b98fd65fa20cffbd3c9e config/SiteData_TM (remotes/origin/Dev) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) -5aa393b2395255ee5fb0c34f2e665e232867964c data/Lib_UNO -1ce443c15f63e6b153b51e79170d2df17ceda220 data/Lib_UNO-json 2b2a04b9a852a2eda9f868b21503badc4eadfb81 qa/TM_QA (4.0.1-24-g2b2a04b)-
This is because new submodules were added to this release, but have not yet been initialized from our parent TM repo. You can either run git submodule init and git submodule update or simply run the /TM/bin/npm_install.sh script, and these new submodules will be initialized within your local environment as a part of the release.
~/GitRepo/WebstormProjects/tekgirl77/TM $ bin/npm_install.sh Submodule 'config/TM_Gulp' (git@github.com:TeamMentor/TM_Gulp.git) registered for path 'build/TM_Gulp' Submodule 'code/TM_Angular' (git@github.com:TeamMentor/TM_Angular.git) registered for path 'code/TM_Angular' Submodule 'Lib_UNO' (git@github.com:tm-sme/Lib_UNO.git) registered for path 'data/Lib_UNO' Submodule 'Lib_UNO-json' (git@github.com:tm-sme/Lib_UNO-json.git) registered for path 'data/Lib_UNO-json' Cloning into 'build/TM_Gulp'... remote: Counting objects: 78, done. remote: Compressing objects: 100% (15/15), done. remote: Total 78 (delta 6), reused 0 (delta 0), pack-reused 63 Receiving objects: 100% (78/78), 11.45 KiB | 0 bytes/s, done. Resolving deltas: 100% (36/36), done. Checking connectivity... done. Submodule path 'build/TM_Gulp': checked out 'c8a6eb8b339d7fb598669700251e8ffb2066c341' Cloning into 'code/TM_Angular'... ...
-
After initializing the new submodules using the /TM/bin/npm_install.sh script, our git submodule command now shows us all commits as well as the remote branch of that commit:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule 4cc3a0c002fad180f86d32ccab22fc74998c675e build/TM_4_0_JSON_Data (remotes/origin/HEAD) c8a6eb8b339d7fb598669700251e8ffb2066c341 build/TM_Gulp (heads/master) 1dbfd2bb74a3281595e611e400059724b7f2ba4f code/TM_Angular (heads/master) 424fa1a51321ddec1ab3c0df0bc43a7c907b53fe code/TM_Flare (remotes/origin/Dev) c1191396c5e77ee50e9f5732795eabcfed9c26a5 code/TM_GraphDB (4.0.1-7-gc119139) 1cd31f45f130a6cdf92f677710d9dd0e1f7cd8a8 code/TM_Jade (remotes/origin/Dev) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) a7a74de7618290f8f9d06ef989f4b22f6f4ecd78 code/TM_Static (remotes/origin/Dev) 51b344e6faa0b2a4bb2432a988eb78db9b5e8232 code/TM_Website (remotes/origin/Dev) 7104fc7eff7b64a88e23b98fd65fa20cffbd3c9e config/SiteData_TM (remotes/origin/Dev) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) 5aa393b2395255ee5fb0c34f2e665e232867964c data/Lib_UNO (remotes/origin/Beta) 1ce443c15f63e6b153b51e79170d2df17ceda220 data/Lib_UNO-json (remotes/origin/Beta) 2b2a04b9a852a2eda9f868b21503badc4eadfb81 qa/TM_QA (4.0.1-24-g2b2a04b)
-
-
-
Or you can choose to do a git fetch if you'd like to examine the changes before deciding whether to merge into your local working copy:
(need actual example showing changes here) ~/GitRepo/WebstormProjects/tekgirl77/TM $ git fetch origin Dev From github.com:TeamMentor/TM * branch Dev -> FETCH_HEAD
-
After doing a git fetch, you will need to explicitly merge any changes into your branch:
```bash ~/GitRepo/WebstormProjects/tekgirl77/TM $ git merge Dev (need actual example here when we have new commits) ```
-
-
Now let's walk through syncing up our Issue_[nn]_[description] branch with any changes we just pulled into the Dev branch.
-
In this example, we have just pulled down the following changes to our Dev branch:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git pull origin Dev remote: Counting objects: 3, done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. From github.com:TeamMentor/TM * branch Dev -> FETCH_HEAD 733bd65..1253768 Dev -> origin/Dev Fetching submodule code/TM_Website remote: Counting objects: 5, done. remote: Compressing objects: 100% (5/5), done. remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (5/5), done. From github.com:TeamMentor/TM_Website 51b344e..fae1baa Dev -> origin/Dev Updating 733bd65..1253768 Fast-forward code/TM_Website | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
-
We can see in the git pull origin Dev merge above, that the TM_Website submodule has been modified. Running a git status also shows that we need to run a git submodule command to sync it back up with our main TM repo:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Dev Your branch is up-to-date with 'origin/Dev'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: code/TM_Website (new commits) no changes added to commit (use "git add" and/or "git commit -a")
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule update Submodule path 'code/TM_Website': checked out 'fae1baa799b1c4626d28dc0a1159e769de3cae95'
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Dev Your branch is up-to-date with 'origin/Dev'. nothing to commit, working directory clean
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule 4cc3a0c002fad180f86d32ccab22fc74998c675e build/TM_4_0_JSON_Data (remotes/origin/HEAD) c8a6eb8b339d7fb598669700251e8ffb2066c341 build/TM_Gulp (heads/master) 1dbfd2bb74a3281595e611e400059724b7f2ba4f code/TM_Angular (heads/master) 424fa1a51321ddec1ab3c0df0bc43a7c907b53fe code/TM_Flare (remotes/origin/Dev) c1191396c5e77ee50e9f5732795eabcfed9c26a5 code/TM_GraphDB (4.0.1-7-gc119139) 1cd31f45f130a6cdf92f677710d9dd0e1f7cd8a8 code/TM_Jade (remotes/origin/Dev) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) a7a74de7618290f8f9d06ef989f4b22f6f4ecd78 code/TM_Static (remotes/origin/Dev) fae1baa799b1c4626d28dc0a1159e769de3cae95 code/TM_Website (remotes/origin/Dev) 7104fc7eff7b64a88e23b98fd65fa20cffbd3c9e config/SiteData_TM (remotes/origin/Dev) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) 5aa393b2395255ee5fb0c34f2e665e232867964c data/Lib_UNO (remotes/origin/Beta) 1ce443c15f63e6b153b51e79170d2df17ceda220 data/Lib_UNO-json (remotes/origin/Beta) 2b2a04b9a852a2eda9f868b21503badc4eadfb81 qa/TM_QA (4.0.1-24-g2b2a04b)
-
-
Now we will checkout our working Issue branch from the parent TM repo:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git checkout Issue_896_POC_5_free_articles M code/TM_Website Switched to branch 'Issue_896_POC_5_free_articles'
-
We notice when checking the branch out above that the code/TM_Website submodule has been modified from the commit "pinned" to this Issue branch. Running a git status also shows us that we need to resync this submodule with our Issue branch, since it was just updated on the Dev branch:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Issue_896_POC_5_free_articles Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: code/TM_Website (new commits) no changes added to commit (use "git add" and/or "git commit -a")
-
Note that when we run our git submodule update command here, the submodule is reverted back to the previous commit that was just modified in the Dev branch. This is the commit still "pinned" to our Issue branch since we have not merged any changes from Dev yet:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule update Submodule path 'code/TM_Website': checked out '51b344e6faa0b2a4bb2432a988eb78db9b5e8232'
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Issue_896_POC_5_free_articles nothing to commit, working directory clean~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule 4cc3a0c002fad180f86d32ccab22fc74998c675e build/TM_4_0_JSON_Data (remotes/origin/HEAD) c8a6eb8b339d7fb598669700251e8ffb2066c341 build/TM_Gulp (heads/master) 1dbfd2bb74a3281595e611e400059724b7f2ba4f code/TM_Angular (heads/master) 424fa1a51321ddec1ab3c0df0bc43a7c907b53fe code/TM_Flare (remotes/origin/Dev) c1191396c5e77ee50e9f5732795eabcfed9c26a5 code/TM_GraphDB (4.0.1-7-gc119139) 1cd31f45f130a6cdf92f677710d9dd0e1f7cd8a8 code/TM_Jade (remotes/origin/Dev) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) a7a74de7618290f8f9d06ef989f4b22f6f4ecd78 code/TM_Static (remotes/origin/Dev) 51b344e6faa0b2a4bb2432a988eb78db9b5e8232 code/TM_Website (remotes/origin/Issue_618_Flare_Wired-14-g51b344e) 7104fc7eff7b64a88e23b98fd65fa20cffbd3c9e config/SiteData_TM (remotes/origin/Dev) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) 5aa393b2395255ee5fb0c34f2e665e232867964c data/Lib_UNO (remotes/origin/Beta) 1ce443c15f63e6b153b51e79170d2df17ceda220 data/Lib_UNO-json (remotes/origin/Beta) 2b2a04b9a852a2eda9f868b21503badc4eadfb81 qa/TM_QA (4.0.1-24-g2b2a04b)
-
-
Now we will merge the latest changes from our local Dev branch to our local Issue branch:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git merge Dev Updating 733bd65..1253768 Fast-forward code/TM_Website | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
-
We see with our git status that our updated Issue branch now recognizes the submodule has changes from the merge which needs to be synced up with our branch:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Issue_896_POC_5_free_articles Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: code/TM_Website (new commits) no changes added to commit (use "git add" and/or "git commit -a")
-
Note that our git submodule command now shows the submodule commit which has changes that have been flagged:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule 4cc3a0c002fad180f86d32ccab22fc74998c675e build/TM_4_0_JSON_Data (remotes/origin/HEAD) c8a6eb8b339d7fb598669700251e8ffb2066c341 build/TM_Gulp (heads/master) 1dbfd2bb74a3281595e611e400059724b7f2ba4f code/TM_Angular (heads/master) 424fa1a51321ddec1ab3c0df0bc43a7c907b53fe code/TM_Flare (remotes/origin/Dev) c1191396c5e77ee50e9f5732795eabcfed9c26a5 code/TM_GraphDB (4.0.1-7-gc119139) 1cd31f45f130a6cdf92f677710d9dd0e1f7cd8a8 code/TM_Jade (remotes/origin/Dev) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) a7a74de7618290f8f9d06ef989f4b22f6f4ecd78 code/TM_Static (remotes/origin/Dev) +51b344e6faa0b2a4bb2432a988eb78db9b5e8232 code/TM_Website (remotes/origin/Issue_618_Flare_Wired-14-g51b344e) 7104fc7eff7b64a88e23b98fd65fa20cffbd3c9e config/SiteData_TM (remotes/origin/Dev) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) 5aa393b2395255ee5fb0c34f2e665e232867964c data/Lib_UNO (remotes/origin/Beta) 1ce443c15f63e6b153b51e79170d2df17ceda220 data/Lib_UNO-json (remotes/origin/Beta) 2b2a04b9a852a2eda9f868b21503badc4eadfb81 qa/TM_QA (4.0.1-24-g2b2a04b) -
Let's run our git submodule update command to sync our Issue branch up with the submodule changes:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule update Submodule path 'code/TM_Website': checked out 'fae1baa799b1c4626d28dc0a1159e769de3cae95'
-
Now our Issue branch is up-to-date with changes made to the parent Dev branch.
~/GitRepo/WebstormProjects/tekgirl77/TM $ git status On branch Issue_896_POC_5_free_articles nothing to commit, working directory clean -
And the git submodule command now shows our submodules synced up and "pinned" to the same commits as we see on the Dev branch:
~/GitRepo/WebstormProjects/tekgirl77/TM $ git submodule 4cc3a0c002fad180f86d32ccab22fc74998c675e build/TM_4_0_JSON_Data (remotes/origin/HEAD) c8a6eb8b339d7fb598669700251e8ffb2066c341 build/TM_Gulp (heads/master) 1dbfd2bb74a3281595e611e400059724b7f2ba4f code/TM_Angular (heads/master) 424fa1a51321ddec1ab3c0df0bc43a7c907b53fe code/TM_Flare (remotes/origin/Dev) c1191396c5e77ee50e9f5732795eabcfed9c26a5 code/TM_GraphDB (4.0.1-7-gc119139) 1cd31f45f130a6cdf92f677710d9dd0e1f7cd8a8 code/TM_Jade (remotes/origin/Dev) eb5d7e361ac72cdaee514c3e49922e9d29a1b13d code/TM_Shared (heads/master) a7a74de7618290f8f9d06ef989f4b22f6f4ecd78 code/TM_Static (remotes/origin/Dev) fae1baa799b1c4626d28dc0a1159e769de3cae95 code/TM_Website (remotes/origin/Dev) 7104fc7eff7b64a88e23b98fd65fa20cffbd3c9e config/SiteData_TM (remotes/origin/Dev) 5286dbd12f0e6118db3946980d2fae8056343b56 data/Lib_Docs-json (heads/master) 5aa393b2395255ee5fb0c34f2e665e232867964c data/Lib_UNO (remotes/origin/Beta) 1ce443c15f63e6b153b51e79170d2df17ceda220 data/Lib_UNO-json (remotes/origin/Beta) 2b2a04b9a852a2eda9f868b21503badc4eadfb81 qa/TM_QA (4.0.1-24-g2b2a04b)
-
-
-
- Click here to view diagrams of the processes described above.