User Tools

Site Tools


git:git-submodules

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
git:git-submodules [2024/11/30 19:13] admingit:git-submodules [2024/12/12 08:44] (current) admin
Line 56: Line 56:
 </code> </code>
  
-==== Working with single submodule ====+==== Working with a particular submodule (not all) ====
  
-If after cloning the main git repo the submodule contains nothing, it can be cloned.+If the main git repo contains many submodules, it can be interesting to work only on one particular submodule. 
 +For example, if after cloning the main git repo the submodule contains nothing, it can be cloned independently of the others submodules
 Suppose the path to submodule (from main repo path) is /path/to/mysubmodule, to clone it type : Suppose the path to submodule (from main repo path) is /path/to/mysubmodule, to clone it type :
 <code bash> <code bash>
Line 66: Line 67:
 If the submodule is not in the correct branch, these commands can be used to list the branches and set to the correct one (ex master) If the submodule is not in the correct branch, these commands can be used to list the branches and set to the correct one (ex master)
 <code bash> <code bash>
-git -C studwork /path/to/mysubmodule branch +git -C /path/to/mysubmodule branch 
-git -C studwork /path/to/mysubmodule checkout master+git -C /path/to/mysubmodule checkout master
 </code> </code>
 In general a git **command** on submodule can be acheived from main git repo by : In general a git **command** on submodule can be acheived from main git repo by :
 <code bash> <code bash>
-git -C studwork /path/to/mysubmodule command+git -C /path/to/mysubmodule command
 </code> </code>
  
  
  
git/git-submodules.1732990422.txt.gz · Last modified: 2024/11/30 19:13 by admin