Gitsubmodule
Complementary script to the 'git submodule' providing easy update and remove
Install / Use
/learn @a14m/GitsubmoduleREADME
gitsubmodule
Complementary script to the git submodule providing easy update and remove.
git submodule update: doesn't pull the latest submodules as I expect it to do.git submodule update --remote: updated all the submodules available.git submodule remove: isn't there and every time I try to do it, I have to google how.
Install
sudo ./install
Uninstall
sudo ./install --uninstall
Usage
gitsubmodule [options | options[args]]
###options
| option | args? | desc. |
|-------------|-------|--------|
| -h,--help | | displays the help|
| --version | | displays the version number|
| -d,--dir | repoDir | provides the directory to the repo by default it's the current directory |
| -u,--update,update | | issue update of the available submodules in the repo |
| -u,--update,update | submodule_name | prompt user to select one of the matched submodule names submodules to update |
| -u,--update,update | --help | display gitsubmodule update specific help |
| -r,--remove,remove || prompt user to select one of the available submodules to delete |
| -r,--remove,remove| submodule_name| prompt user to select one of the matched submodule names submodules to delete |
| -r,--remove,remove| --help | display gitsubmodule remove specific help |
Update
- Updates the available submodules found in the .gitmodules file if no args was provided
- If args was provided, it will prompt the user to choose one of the matches to args to update it if more than 1 match occured
####Procedure :
- cd into the submodule directory
- stash the changes in the submodule
- check out master branch to fix an issue where you are on (no-branch)
- git pull latest changes
- reapply stashed changes
Remove
- If no args was passed the script will find all the available submodules, and will prompt the user to choose one of them to delete.
- If args was provided the script will find all the available matches to this submodule,
then it will prompt the user to choose one of the matches to delete it if more than 1 match occured,
or will prompt the user on deleting the matched submodule if only 1 match was found.
####Procedure :
- remove the submodule part from .gitmodules
- remove the submodule part from .git/config
- remove the the submodule cached directory
- remove the submodule from .git/modules directory
- commit the changes to the modified files only
- remove the submodule directory
Examples
gitsubmodule update issue update to all the submodules available.
gitsubmodule update nerd prompt the user to update submodules that matches this search ex. nerdTree, nerdCommenter.
gitsubmodule update --help display help of the update.
gitsubmodule remove prompt the user to remove one of the available submodules.
gitsubmodule remove nerd show the matched submodules in the vim ex. nerdTree,nerdCommenter.
if only one of them is available ,prompt removing it and commit.
if both are available prompt the user to remove one of them and commit.
gitsubmodule remove --help display help of the remove.
Bugs
Please report found bugs to https://github.com/artmees/gitsubmodule/issues
COPYRIGHT
Copyright (C) 2013, Ahmed Abdel Razzak. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or see http://www.gnu.org/licenses/.
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

