为了完成Thilo的好答案,一旦你将svn repo导入git,你可以使用脚本将git存储库添加到你的库中,详见合并无关的git分支
#!/bin/bash
set -e
if test -z "$2" -o -n "$3"; then
echo "usage: $0 REPO BRANCHNAME" >&2
exit 1
fi
repo=$1
branch=$2
git fetch "$repo" "$branch"
head=$(git rev-parse HEAD)
fetched=$(git rev-parse FETCH_HEAD)
headref=$(git rev-parse --symbolic-full-name HEAD)
git checkout $fetched .
tree=$(git write-tree)
newhead=$(echo "merged in branch '$branch' from $repo" | git commit-tree $tree -p $head -p $fetched)
git-update-ref $headref $newhead $head
git reset --hard $headref
Run Code Online (Sandbox Code Playgroud)
其他方法包括:
git pull REPO BRANCH| 归档时间: |
|
| 查看次数: |
2778 次 |
| 最近记录: |