-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
61 lines (47 loc) · 1.12 KB
/
Copy pathtest.sh
File metadata and controls
61 lines (47 loc) · 1.12 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
set -ex
rm -rf .git
git init
REMOTE=git@github.com:batchor/test
git remote add origin $REMOTE
git add test.sh && git commit -m 'test' && git push -u origin main -f
rm -rf repo1 repo2
git clone $REMOTE repo1
git clone $REMOTE repo2
cd repo1
echo "This is a test commit-abc" >> test.txt
git add test.txt && git commit -m 'repo1: 1'
git push
echo "This is a test commit-def" >> test.txt
git add test.txt && git commit -m 'repo1: 2'
git push
cd ../repo2
echo "This is a test commit-123" >> test1.txt
git add . && git commit -m 'repo2: 1'
{
git pull --ff-only
} || {
echo "Cannot git pull --ff-only!!!!!!!!!!!!!!!!"
}
{
git pull --ff --no-edit
} || {
echo "Cannot git pull --ff!!!!!!!!!!!!!!!!"
}
cd ../repo1
echo "This is a test commit-456" >> test.txt
git add ./ && git commit -m 'repo1: 3'
git push
cd ../repo2
# edit the same file
echo "This is a test commit-789" >> test.txt
git add . && git commit -m 'repo2: 2'
{
git pull --ff-only
} || {
echo "Cannot git pull --ff-only!!!!!!!!!!!!!!!!"
}
{
git pull --ff --no-edit -X theirs
} || {
echo "Cannot git --ff --no-edit -Xtheirs !!!!!!!!!!!!!!!!"
}