![No speech recorder](https://loka.nahovitsyn.com/94.jpg)
There are some things in Git submodules, which aren't obvious and can be quite surprising.
#Git add remote submodule update#
3.5 Figure: Workflow of an update of your submodulesįirst a short explanation of events which are triggered, when a superproject is cloned.2.2 Figure: Updates without customization.2 Upgrading your submodules via the superproject.# Update each submodule path to correct revision, using clone and checkout as needed Rev = $ ( git rev - list - n 1 "$2" - not - all 2 >/ dev / null ) & ")"Įval_gettextln "Reactivating local git directory for submodule '\$sm_name'." Or you are unsure what this means choose another name with the '-name' option. If the local git directory is not the correct repo If you want to reuse this local git directory instead of cloning again from GIT_DIR = ".git/modules/$sm_name" GIT_WORK_TREE =. gitĮval_gettextln "Adding existing repo at '\$sm_path' to the index"ĭie "$(eval_gettext "'\$sm_path' already exists and is not a valid git repo ")"Įval_gettextln >& 2 "A git directory for '\$sm_name' is found locally with remote(s):"
![git add remote submodule git add remote submodule](https://cdn.ttgtmedia.com/rms/onlineImages/SideCOM_github-remote-add-origin-success_004_half_column_desktop.jpg)
# perhaps the path exists and is already a git repo, else clone it If ! git submodule - helper check - name "$sm_name"ĭie "$(eval_gettext "'$sm_name' is not a valid submodule name ")" Use -f if you really want to add it." >& 2 ! git add - dry - run - ignore - missing - no - warn - embedded - repo "$sm_path" > / dev / null 2 >& 1Įval_gettextln "The following path is ignored by one of your. Git ls - files - s "$sm_path" | sane_grep - v "^160000" > / dev / null 2 >& 1 &ĭie "$(eval_gettext "'\$sm_path' already exists in the index and is not a submodule ")" Git ls - files - error - unmatch "$sm_path" > / dev / null 2 >& 1 &ĭie "$(eval_gettext "'\$sm_path' already exists in the index ")" Realrepo = $ ( git submodule - helper resolve - relative - url "$repo" ) || exitĭie "$(eval_gettext " repo URL : '\$repo' must be absolute or begin with. # dereference source url relative to parent's url # assure repo is absolute or relative to parentĭie "$(gettext " Relative path can only be used from the toplevel of the working tree ")" Is_absolute_path "$sm_path" || sm_path = "$wt_prefix$sm_path" If test - z "$repo" || test - z "$sm_path" then Reference_path = "$wt_prefix$reference_path" # optional branch is stored in global branch variable
![git add remote submodule git add remote submodule](https://i.stack.imgur.com/8a73P.png)
# Add a new submodule to the working tree. # of the settings from GIT_CONFIG_PARAMETERS. # can't simply use clear_local_git_env since we want to preserve some # Sanitize the local git environment for use within a submodule. gitmodules either, print a default value. # customizing individual repositories if necessary. # Checks in the usual git-config places first (for overrides), # Print a submodule configuration setting
![git add remote submodule git add remote submodule](https://blog.sourcetreeapp.com/files/2013/12/pull-subtree-blog.jpeg)
# directly from the user, so it can apply policy as appropriate.
![git add remote submodule git add remote submodule](http://www.crmkonsulterna.se/app/uploads/2020/04/13-Checkout-submodule-master-1024x576-1.png)
# Tell the rest of git that any URLs we get don't come Wt_prefix = $ ( git rev - parse - show - prefix ) # git-submodule.sh: add, init, update or list git submodulesĭashless = $ ( basename "$0" | sed - e 's/-/ /' )
![No speech recorder](https://loka.nahovitsyn.com/94.jpg)