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.
sudo ./install
sudo ./install --uninstall
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 |
- 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
- 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
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.
Please report found bugs to https://github.com/artmees/gitsubmodule/issues
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/.