2014年5月3日 星期六

使用 git subtree 切分版本庫

有候我們希望把一個大的 Git Repository 切分成多個 Repositories。這時我們就可以用 git subtree 這個指令。以下我以 Android NDK 為例子:

$ git clone https://android.googlesource.com/platform/ndk
$ cd ndk

分割 sources/cxx-stl/llvm-libc++abi/libcxxabi 下面的 commits:

$ git subtree split -P sources/cxx-stl/llvm-libc++abi/libcxxabi -b libcxxabi

之後只要另外在不同的資料夾執行:

$ cd ..
$ git init libcxxabi
$ cd libcxxabi
$ git pull ../ndk libcxxabi:master

就可以有一個完全獨立的版本庫了!

參考資料

1 則留言:

  1. The iconic slot from Pragmatic Play is coming to Live Casino with all its superb and colourful options providing pleasure, volatility and mega multipliers in a Game Show format. Load up on sugar in Sweet Bonanza™, the 6×5, pays anyplace, tumbling videoslot. Pragmatic Play is a number one} game developer providing player-favourites to probably the most successful world brands in the iGaming industry. Freshen up your ground, have interaction players and drive progress with IGT Fruit Games. Playtime is much more enjoyable with monster prizes up for 먹튀사이트 먹튀프렌즈3 grabs.

    回覆刪除