Git Submodule: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
│ └─ AcademiaApp | │ └─ AcademiaApp | ||
├─ server | ├─ server | ||
│ ├─ academia- | │ ├─ academia-apps-ckiapi.git | ||
│ ├─ academia- | │ ├─ academia-apps-ckirui.git | ||
│ └─ academia- | │ └─ academia-apps-ckiapp.git | ||
└─ client | └─ client | ||
├─ AcademiaApi | ├─ AcademiaApi | ||
Line 17: | Line 17: | ||
' | ' | ||
cd /opt/chorke/academia/server/ | cd /opt/chorke/academia/server/ | ||
git init --bare academia- | git init --bare academia-apps-ckiapi.git | ||
git init --bare academia- | git init --bare academia-apps-ckigui.git | ||
git init --bare academia- | git init --bare academia-apps-ckiapp.git | ||
</source> | </source> | ||
Line 31: | Line 31: | ||
' | ' | ||
cd /opt/chorke/academia/master/AcademiaApi;git init | cd /opt/chorke/academia/master/AcademiaApi;git init | ||
git remote add origin /opt/chorke/academia/server/academia- | git remote add origin /opt/chorke/academia/server/academia-apps-ckiapi.git | ||
git add --all; git commit -m 'initial commit' | git add --all; git commit -m 'initial commit'; git push origin master | ||
git push origin master | |||
</source> | </source> | ||
Line 44: | Line 43: | ||
' | ' | ||
cd /opt/chorke/academia/master/AcademiaGui;git init | cd /opt/chorke/academia/master/AcademiaGui;git init | ||
git remote add origin /opt/chorke/academia/server/academia- | git remote add origin /opt/chorke/academia/server/academia-apps-ckigui.git | ||
git add --all; git commit -m 'initial commit' | git add --all; git commit -m 'initial commit'; git push origin master | ||
git push origin master | |||
</source> | </source> | ||
Line 57: | Line 55: | ||
' | ' | ||
cd /opt/chorke/academia/master/AcademiaApp;git init | cd /opt/chorke/academia/master/AcademiaApp;git init | ||
git remote add origin /opt/chorke/academia/server/academia- | git remote add origin /opt/chorke/academia/server/academia-apps-ckiapp.git | ||
git add --all; git commit -m 'initial commit' | git add --all; git commit -m 'initial commit'; git push origin master | ||
git push origin master | |||
</source> | </source> | ||
<source lang="bash"> | <source lang="bash"> | ||
:' | :' | ||
git submodule add /opt/chorke/academia/server/academia- | git submodule add /opt/chorke/academia/server/academia-apps-ckiapi.git | ||
git submodule add /opt/chorke/academia/server/academia- | git submodule add /opt/chorke/academia/server/academia-apps-ckigui.git | ||
git rm --cached academia- | |||
git rm --cached academia-apps-ckiapi; git rm --cached academia-apps-ckigui | |||
git rm --cached .gitmodules; git reset --hard; git clean -fd | git rm --cached .gitmodules; git reset --hard; git clean -fd | ||
rm -rf academia- | rm -rf academia-apps-cki* | ||
' | ' | ||
git submodule add /opt/chorke/academia/server/academia- | |||
git submodule add /opt/chorke/academia/server/academia- | git submodule add /opt/chorke/academia/server/academia-apps-ckiapi.git AcademiaApi | ||
git submodule add /opt/chorke/academia/server/academia-apps-ckigui.git AcademiaGui | |||
git config -f .gitmodules submodule.AcademiaApi.branch master | git config -f .gitmodules submodule.AcademiaApi.branch master | ||
Line 84: | Line 83: | ||
#academia/client/AcademiaApp | #academia/client/AcademiaApp | ||
cd /opt/chorke/academia/client/ | cd /opt/chorke/academia/client/ | ||
git clone /opt/chorke/academia/server/academia- | git clone /opt/chorke/academia/server/academia-apps-ckiapp.git AcademiaApp | ||
cd AcademiaApp | cd AcademiaApp | ||
git submodule init | git submodule init | ||
git submodule update | git submodule update | ||
#AcademiaApp/AcademiaGui | #client/AcademiaApp/AcademiaGui | ||
cd /opt/chorke/academia/client/AcademiaApp/AcademiaGui/ | cd /opt/chorke/academia/client/AcademiaApp/AcademiaGui/ | ||
vim HelloGui.txt | vim HelloGui.txt | ||
Line 95: | Line 94: | ||
#academia/client/AcademiaApp | #academia/client/AcademiaApp | ||
vim HelloApp.txt | vim HelloApp.txt;git add HelloApp.txt | ||
git add | git commit -m 'Hello App Added' | ||
git status | git status | ||
#AcademiaApp/AcademiaGui | #client/AcademiaApp/AcademiaGui | ||
cd AcademiaGui/ | cd AcademiaGui/ | ||
git add --all; git commit -m 'Hello Gui Added' | git add --all; git commit -m 'Hello Gui Added' | ||
Line 128: | Line 127: | ||
git push origin master | git push origin master | ||
# master/ | #academia/master/AcademiaGui | ||
cd /opt/chorke/academia/master/AcademiaGui/ | cd /opt/chorke/academia/master/AcademiaGui/ | ||
vim HelloAdd.txt | vim HelloAdd.txt;git add HelloAdd.txt; | ||
git add HelloAdd.txt;git commit -m 'Hello Add Text File Added' | git commit -m 'Hello Add Text File Added' | ||
git push origin master | git push origin master | ||
# client/ | #client/AcademiaApp/AcademiaGui | ||
cd /opt/chorke/academia/client/AcademiaApp/AcademiaGui/ | cd /opt/chorke/academia/client/AcademiaApp/AcademiaGui/ | ||
git pull origin master | git pull origin master | ||
cd .. | cd .. | ||
# client/ | #academia/client/AcademiaApp | ||
git status | git status | ||
git add AcademiaGui | git add AcademiaGui | ||
Line 145: | Line 144: | ||
git push origin master | git push origin master | ||
# master/ | #academia/master/AcademiaApp | ||
cd /opt/chorke/academia/master/AcademiaApp/ | cd /opt/chorke/academia/master/AcademiaApp/ | ||
git submodule foreach git pull origin master | git submodule foreach git pull origin master | ||
git pull origin master | git pull origin master | ||
</source> | </source> |
Revision as of 10:07, 12 December 2019
Structure
:'
/opt/chorke/academia
├─ master
│ ├─ AcademiaApi
│ ├─ AcademiaGui
│ └─ AcademiaApp
├─ server
│ ├─ academia-apps-ckiapi.git
│ ├─ academia-apps-ckirui.git
│ └─ academia-apps-ckiapp.git
└─ client
├─ AcademiaApi
├─ AcademiaGui
└─ AcademiaApp
'
cd /opt/chorke/academia/server/
git init --bare academia-apps-ckiapi.git
git init --bare academia-apps-ckigui.git
git init --bare academia-apps-ckiapp.git
Master
:'
/opt/chorke/academia/master/AcademiaApi
├─ .gitignore
├─ LICENSE
└─ README.md
'
cd /opt/chorke/academia/master/AcademiaApi;git init
git remote add origin /opt/chorke/academia/server/academia-apps-ckiapi.git
git add --all; git commit -m 'initial commit'; git push origin master
:'
/opt/chorke/academia/master/AcademiaGui
├─ .gitignore
├─ LICENSE
└─ README.md
'
cd /opt/chorke/academia/master/AcademiaGui;git init
git remote add origin /opt/chorke/academia/server/academia-apps-ckigui.git
git add --all; git commit -m 'initial commit'; git push origin master
:'
/opt/chorke/academia/master/AcademiaApp
├─ .gitignore
├─ LICENSE
└─ README.md
'
cd /opt/chorke/academia/master/AcademiaApp;git init
git remote add origin /opt/chorke/academia/server/academia-apps-ckiapp.git
git add --all; git commit -m 'initial commit'; git push origin master
:'
git submodule add /opt/chorke/academia/server/academia-apps-ckiapi.git
git submodule add /opt/chorke/academia/server/academia-apps-ckigui.git
git rm --cached academia-apps-ckiapi; git rm --cached academia-apps-ckigui
git rm --cached .gitmodules; git reset --hard; git clean -fd
rm -rf academia-apps-cki*
'
git submodule add /opt/chorke/academia/server/academia-apps-ckiapi.git AcademiaApi
git submodule add /opt/chorke/academia/server/academia-apps-ckigui.git AcademiaGui
git config -f .gitmodules submodule.AcademiaApi.branch master
git config -f .gitmodules submodule.AcademiaGui.branch master
git commit -m 'academia-ruap-{ckiapi,ckigui} added'
git push origin master
Client
#academia/client/AcademiaApp
cd /opt/chorke/academia/client/
git clone /opt/chorke/academia/server/academia-apps-ckiapp.git AcademiaApp
cd AcademiaApp
git submodule init
git submodule update
#client/AcademiaApp/AcademiaGui
cd /opt/chorke/academia/client/AcademiaApp/AcademiaGui/
vim HelloGui.txt
cd ..
#academia/client/AcademiaApp
vim HelloApp.txt;git add HelloApp.txt
git commit -m 'Hello App Added'
git status
#client/AcademiaApp/AcademiaGui
cd AcademiaGui/
git add --all; git commit -m 'Hello Gui Added'
git status
cd ..
#academia/client/AcademiaApp
git status
git submodule status --recursive
git submodule foreach git push -u origin master
git submodule foreach git pull origin master
#academia/master/AcademiaGui
cd /opt/chorke/academia/master/AcademiaGui/
git pull origin master
#client/AcademiaApp/AcademiaGui
cd /opt/chorke/academia/client/AcademiaApp/AcademiaGui/
git checkout master; vim HelloGui.txt
git add --all;git commit -m 'Hello GUI Added'
git push origin master
cd ..
#academia/client/AcademiaApp
git add AcademiaGui
git commit -m 'AcademiaGui updated'
git push origin master
#academia/master/AcademiaGui
cd /opt/chorke/academia/master/AcademiaGui/
vim HelloAdd.txt;git add HelloAdd.txt;
git commit -m 'Hello Add Text File Added'
git push origin master
#client/AcademiaApp/AcademiaGui
cd /opt/chorke/academia/client/AcademiaApp/AcademiaGui/
git pull origin master
cd ..
#academia/client/AcademiaApp
git status
git add AcademiaGui
git commit -m 'AcademiaGui updated'
git push origin master
#academia/master/AcademiaApp
cd /opt/chorke/academia/master/AcademiaApp/
git submodule foreach git pull origin master
git pull origin master