Developer guide for git sub module used in Admin UI - GluuFederation/gluu-admin-ui GitHub Wiki
Overview
In Admin UI each plugin is a git submodule.
Cloning Admin-UI
To clone Admin-UI project with all submodules we should use below command.
git clone https://github.com/GluuFederation/gluu-admin-ui.git --recurse-submodule
Updating submodules
git submodule update --init --recursive //the first time you check-out a repo you need to use --init
Deleting a submodule
git submodule deinit -f -- plugins/aui-admin-plugin
rm -rf .git/modules/plugins/aui-admin-plugin
git rm -f plugins/aui-admin-plugin
Pushing a change to sub-module
- Change directory to the submodule directory (say
aui-admin-plugin
) and commit, push the changes there.
cd aui-admin-plugin
git status
git add .
git commit -m "commit_message"
git push origin <branch_name>
- Then go back to parent admin-ui project and commit, push the changes there too.
cd ..
git status
git add .
git commit -m "commit_message"
git push origin <branch_name>
Creating a new branch of admin-ui project with its submodules.
- To create new branch
main_bkp
of admin-ui project execute.
git branch main_bkp
git checkout main_bkp
git push origin main_bkp
- Now to create a new branch of
aui-admin-plugin
execute
cd aui-admin-plugin
git checkout main
git checkout main_bkp
git push origin main_bkp
Create PR of admin-ui with changes in submodule.
- Create PR of admin-ui project for example
into main from main_bkp
- Create PR of the changed sub-module for example
into main from main_bkp
Ref: https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial#Removal