顯示具有 Subversion 標籤的文章。 顯示所有文章
顯示具有 Subversion 標籤的文章。 顯示所有文章

2009年8月26日 星期三

將 Subversion Repository 搬進 Google Code 裡面

由於 http://pcmanx.csie.net 的管理者 lwhsu 好像去玩國軍 Online 了
加上網頁一直無法更新還有常常會遇到網站掛點的狀況
所以動起了幫 PCManX GTK+ 搬家的念頭
以下是筆記將 Subversion Repository 搬進 Google Code 的過程
  1. 首先建立本地端的 mirror
    $ svnadmin create pcmanx
    $ cat <<'EOF' > pcmanx/hooks/pre-revprop-change
    #!/bin/sh
    USER="$3"
    if [ "$USER" = "svnsync" ]; then exit 0; fi
    echo "Only the svnsync user can change revprops" >&2
    exit 1
    EOF
    $ chmod +x pcmanx/hooks/pre-revprop-change
    $ svnsync init file://`pwd`/pcmanx https://svn.csie.net/pcmanx
    $ svnsync sync file://`pwd`/pcmanx
  2. 然後將 mirror 同步到 Google Code 上面
    $ svnsync init --username fourdollars https://pcmanx-gtk2.googlecode.com/svn file://`pwd`/pcmanx
    $ svnsync sync --username fourdollars https://pcmanx-gtk2.googlecode.com/svn
  3. 如果中途中斷遇到 lock 問題, 可以這樣解決, 不過要確定沒有人在使用該 Subversion Repository
    $ svn pdel --revprop -r 0 svn:sync-lock https://pcmanx-gtk2.googlecode.com/svn
    $ svnsync sync --username fourdollars https://pcmanx-gtk2.googlecode.com/svn
這樣就大功告成啦~ 以後如果有類似的狀況可以把粗體字的部份換掉就可以了~ :D

2009年8月17日 星期一

Commit your git changesets into Subversion

Commit your git changesets into Subversion
  • First prepare your Subversion target folder, ex. http://svn.example.com/svn/git-backup
    $ svn mkdir --parents http://svn.example.com/svn/git-backup
  • Configure your git-svn on your original git working folder.
    $ git-svn init http://svn.example.com/svn/git-backup
  • Fetch Subversion changesets.
    $ git-svn fetch
  • Manually graft relationship.
    $ git show-ref git-svn
    8ec71dda61a3a32d9cf0c00e51a0c1ca3ea39f0e refs/remotes/git-svn
    $ git log --pretty=oneline master | tail -n1
    bcbd25a12642e98e1c54a8e51abacd85222b79a7 Your latest git commit log.
    $ echo "bcbd25a12642e98e1c54a8e51abacd85222b79a7 8ec71dda61a3a32d9cf0c00e51a0c1ca3ea39f0e" >> .git/info/grafts
  • Then push all git changesets into Subversion repository.
    $ git-svn dcommit
With Standard Layout
  • First prepare your Subversion target folder, ex. http://svn.example.com/svn/git-backup/{trunk,branches,tags}
    $ svn mkdir --parents http://svn.example.com/svn/git-backup/trunk http://svn.example.com/svn/git-backup/branches http://svn.example.com/svn/git-backup/tags
  • Configure your git-svn on your original git working folder.
    $ git-svn init --stdlayout http://svn.example.com/svn/git-backup
  • Fetch Subversion changesets.
    $ git-svn fetch
  • Manually graft relationship.
    $ git show-ref trunk
    8ec71dda61a3a32d9cf0c00e51a0c1ca3ea39f0e refs/remotes/git-svn
    $ git log --pretty=oneline master | tail -n1
    bcbd25a12642e98e1c54a8e51abacd85222b79a7 Your latest git commit log.
    $ echo "bcbd25a12642e98e1c54a8e51abacd85222b79a7 8ec71dda61a3a32d9cf0c00e51a0c1ca3ea39f0e" >> .git/info/grafts
  • Then push all git changesets into Subversion repository.
    $ git-svn dcommit

2008年3月19日 星期三

Subversion 心得分享

在過年期間無聊打發時間的時候看了一下 Subversion Book
加上之前在國內某間軟體外商工作過的經驗
心中累積了一些軟體專案程式碼管理的想法
3/27 在 KatDC Open Space Forum 上面分享一些在軟體專案開發上版本控管的心得
主要的概念是軟體專案中的角色扮演跟責任的劃分
詳細的內容會在這個心得分享的活動當中介紹
報名的網址在 http://www.katdc.com/kosforum/index.jsp
--
P.S. 主辦活動的同事是正妹, 正妹說希望有多一點人可以報名參加. :)