Skip to content

Commit b2798df

Browse files
authored
Merge pull request #18 from turfaa/migrasi-svn-git
Convert migrasi-svn-git to markdown format
2 parents 7b63d6d + 962b3a2 commit b2798df

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

migrasi-svn-git renamed to migrasi-svn-git.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,65 @@
1-
Langkah Migrasi dari Subversion ke Git
1+
# Langkah Migrasi dari Subversion ke Git
22

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

78
2. Copy ke pc kita sendiri supaya cepat prosesnya
89

910
3. Restore lagi
11+
```shell
1012
svnadmin load /path/ke/repo/svn < nama-file-dump
13+
```
1114

12-
4. Checkout
15+
4. Checkout
16+
```shell
1317
svn co file:///path/ke/repo/svn checkout-project-svn
18+
```
1419

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

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

2836
7. Masuk ke folder hasil clone
37+
```shell
2938
cd git-svn-migrasi-project
39+
```
3040

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

3446
9. Konversi tag svn menjadi tag git
47+
```shell
3548
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+
```
3650

37-
10. Konversi svn-ignore menjadi gitignore
51+
10. Konversi `svn-ignore` menjadi `gitignore`
52+
```shell
3853
git svn show-ignore > .gitignore
3954
git add .gitignore
4055
git commit -m "konversi svn ignore menjadi gitignore"
56+
```
4157

4258
11. Clone supaya bersih
59+
```shell
4360
cd ..
4461
git clone --bare git-svn-migrasi-project nama-project.git
62+
```
4563

4664
12. Copy ke server untuk disharing menggunakan Gitosis
4765

0 commit comments

Comments
 (0)