-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes12.txt
More file actions
46 lines (37 loc) · 1.44 KB
/
Copy pathnotes12.txt
File metadata and controls
46 lines (37 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Submodules
#Sharing Libraries
#a git repor inside a git repo
#add submodule git repo to current git repo
git submodule add git@example.com:css.git
#creates
.gitmodules #config for Submodules
css/ #new directory/Submodule itself
#Modifying Submodule Code
cd css/
git checkout master #checkout submodule branch
#make changes
git status
git commit -am "update menu font." #commit to submodule master branch
git push #push to submodule origin repo branch
cd .. #go back to main git repo
git status
git add css #add changes to css submodule
git commit -m "update menu font in css/" #commit
git push #push
#Cloning Projects
git clone git@example.com:aquarium.git
#creates .gitmodules clownfish.html guppy.html index.html css/ js/
#both css/ & js/ are empty directories
git submodule init #Submodule init
git submodule update #pulls down repo code files
#Make changes to CSS Submodule
cd css
git status
git checkout master
git add example.css
git commit -m "update menu font"
#Pushing submodules DON'T FORGET!
git push --recurse-submodules=check #checks to make sure submodules were pushed. Will abort if not
git push --recurse-submodules=on-demand #will automatically push for the submodule if parent is being pushed
#make this a git alias
git config alias.pushall "push --recurse-submodules=on-demand"