File tree Expand file tree Collapse file tree 1 file changed +80
-0
lines changed Expand file tree Collapse file tree 1 file changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ @ Echo Batch script for demo - how to handle with remote working copy
2
+ @ Echo main_repo - main (bare) repo
3
+ @ Echo first_wc - work clone of main repo
4
+ @ Echo second_bare - bare clone of main repo. Used as remote shared
5
+ @ Echo third_wc - work clone of second_bare
6
+
7
+ @ echo Create bare host repo
8
+
9
+ git init --bare main_repo
10
+
11
+ @ echo Create first working clone
12
+
13
+ git clone main_repo first_wc
14
+
15
+ cd first_wc
16
+
17
+ echo 123 > 1.txt
18
+
19
+ git add 1.txt
20
+
21
+ git status
22
+
23
+ git commit -m " 1 from first wc"
24
+
25
+ git push origin master:master
26
+
27
+ cd ..
28
+
29
+ @ echo Create bare clone for remote shared
30
+
31
+ git clone --bare main_repo second_bare
32
+
33
+ @ echo Create work clone from remote shared
34
+
35
+ git clone second_bare third_wc
36
+
37
+ cd first_wc
38
+
39
+ echo 456 >> 1.txt
40
+
41
+ git add 1.txt
42
+
43
+ git commit -m " 2 from first wc"
44
+
45
+ git push
46
+
47
+ cd ..\second_bare
48
+
49
+ git --no-pager log
50
+
51
+ git fetch origin master:master
52
+
53
+ git --no-pager log
54
+
55
+ cd ..\third_wc
56
+
57
+ git fetch
58
+
59
+ git pull
60
+
61
+
62
+ echo 789 >> 1.txt
63
+
64
+ git add 1.txt
65
+
66
+ git commit -m " 3 from third wc"
67
+
68
+ git push
69
+
70
+ cd ..\second_bare
71
+
72
+ git push
73
+
74
+ cd ..\first_wc
75
+
76
+ git pull
77
+
78
+ git --no-pager log
79
+
80
+ type 1.txt
You can’t perform that action at this time.
0 commit comments