Skip to content

Commit bf0273f

Browse files
committed
migrasi-svn-git.md: fix formatting
1 parent b81c191 commit bf0273f

File tree

1 file changed

+38
-39
lines changed

1 file changed

+38
-39
lines changed

migrasi-svn-git.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,64 @@
11
# Langkah Migrasi dari Subversion ke Git
22

33
1. Dump repository Subversion
4-
```shell
5-
svnadmin dump /path/ke/repo/svn > nama-file-dump
6-
```
4+
```bash
5+
svnadmin dump /path/ke/repo/svn > nama-file-dump
6+
```
77

88
2. Copy ke pc kita sendiri supaya cepat prosesnya
99

1010
3. Restore lagi
11-
```shell
12-
svnadmin load /path/ke/repo/svn < nama-file-dump
13-
```
11+
```bash
12+
svnadmin load /path/ke/repo/svn < nama-file-dump
13+
```
1414

1515
4. Checkout
16-
```shell
17-
svn co file:///path/ke/repo/svn checkout-project-svn
18-
```
16+
```bash
17+
svn co file:///path/ke/repo/svn checkout-project-svn
18+
```
1919

2020
5. Generate authors file
21-
```shell
22-
#!/usr/bin/env bash
23-
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
24-
for author in ${authors}; do
25-
echo "${author} = NAME <USER@DOMAIN>";
26-
done
27-
```
28-
Simpan hasilnya ke `file-authors.txt`.
29-
Ini akan kita gunakan di langkah selanjutnya.
21+
```bash
22+
#!/usr/bin/env bash
23+
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
24+
for author in ${authors}; do
25+
echo "${author} = NAME <USER@DOMAIN>";
26+
done
27+
```
28+
Simpan hasilnya ke `file-authors.txt`. Ini akan kita gunakan di langkah selanjutnya.
3029

3130
6. Checkout lagi menggunakan `git-svn`
32-
```shell
33-
git svn clone --stdlayout --no-metadata -A file-authors.txt file:///path/ke/repo git-svn-migrasi-project
34-
```
31+
```bash
32+
git svn clone --stdlayout --no-metadata -A file-authors.txt file:///path/ke/repo git-svn-migrasi-project
33+
```
3534

3635
7. Masuk ke folder hasil clone
37-
```shell
38-
cd git-svn-migrasi-project
39-
```
36+
```bash
37+
cd git-svn-migrasi-project
38+
```
4039

4140
8. Konversi branch svn menjadi branch git
42-
```shell
43-
git branch -r | grep -v tags | sed -rne 's, *([^@]+)$,\1,p' | while read branch; do echo "git branch $branch $branch"; done | sh
44-
```
41+
```bash
42+
git branch -r | grep -v tags | sed -rne 's, *([^@]+)$,\1,p' | while read branch; do echo "git branch $branch $branch"; done | sh
43+
```
4544

4645
9. Konversi tag svn menjadi tag git
47-
```shell
48-
git branch -r | sed -rne 's, *tags/([^@]+)$,\1,p' | while read tag; do echo "git tag $tag 'tags/${tag}^'; git branch -r -d tags/$tag"; done | sh
49-
```
46+
```bash
47+
git branch -r | sed -rne 's, *tags/([^@]+)$,\1,p' | while read tag; do echo "git tag $tag 'tags/${tag}^'; git branch -r -d tags/$tag"; done | sh
48+
```
5049

5150
10. Konversi `svn-ignore` menjadi `gitignore`
52-
```shell
53-
git svn show-ignore > .gitignore
54-
git add .gitignore
55-
git commit -m "konversi svn ignore menjadi gitignore"
56-
```
51+
```bash
52+
git svn show-ignore > .gitignore
53+
git add .gitignore
54+
git commit -m "konversi svn ignore menjadi gitignore"
55+
```
5756

5857
11. Clone supaya bersih
59-
```shell
60-
cd ..
61-
git clone --bare git-svn-migrasi-project nama-project.git
62-
```
58+
```bash
59+
cd ..
60+
git clone --bare git-svn-migrasi-project nama-project.git
61+
```
6362

6463
12. Copy ke server untuk disharing menggunakan Gitosis
6564

0 commit comments

Comments
 (0)