Skip to content

Commit

Permalink
Convert migrasi-svn-git to markdown format
Browse files Browse the repository at this point in the history
  • Loading branch information
turfaa committed Oct 24, 2016
1 parent aea7f03 commit 962b3a2
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions migrasi-svn-git → migrasi-svn-git.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,65 @@
Langkah Migrasi dari Subversion ke Git
# Langkah Migrasi dari Subversion ke Git

1. Dump repository Subversion
```shell
svnadmin dump /path/ke/repo/svn > nama-file-dump

```

2. Copy ke pc kita sendiri supaya cepat prosesnya

3. Restore lagi
```shell
svnadmin load /path/ke/repo/svn < nama-file-dump
```

4. Checkout
4. Checkout
```shell
svn co file:///path/ke/repo/svn checkout-project-svn
```

5. Generate authors file
```shell
#!/usr/bin/env bash
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
done

Simpan hasilnya ke file-authors.txt.
```
Simpan hasilnya ke `file-authors.txt`.
Ini akan kita gunakan di langkah selanjutnya.

6. Checkout lagi menggunakan git-svn
6. Checkout lagi menggunakan `git-svn`
```shell
git svn clone --stdlayout --no-metadata -A file-authors.txt file:///path/ke/repo git-svn-migrasi-project
```

7. Masuk ke folder hasil clone
```shell
cd git-svn-migrasi-project
```

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

9. Konversi tag svn menjadi tag git
```shell
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
```

10. Konversi svn-ignore menjadi gitignore
10. Konversi `svn-ignore` menjadi `gitignore`
```shell
git svn show-ignore > .gitignore
git add .gitignore
git commit -m "konversi svn ignore menjadi gitignore"
```

11. Clone supaya bersih
```shell
cd ..
git clone --bare git-svn-migrasi-project nama-project.git
```

12. Copy ke server untuk disharing menggunakan Gitosis

Expand Down

0 comments on commit 962b3a2

Please sign in to comment.