2010-01-29 4 views
0

Git 내에서 SVN의 원격 분기를 추적하고 싶습니다. 나는 자식 - svn을 명령으로이 작업을 수행하는 방법의 기초, 나는 다음과 같은 것을 할 기대했다 볼 수 있습니다 : 나는 자식/마스터 병합 그래서 한 번자식과 함께 Subversion에서 단일 분기를 추적하는 방법

Git branch | SVN branch 
----------------------- 
master  | Trunk 
feature1 | <not mapped> 
feature2 | <not mapped> 

을하고 dcommit, 트렁크을 마지막 svn 커밋과 git/HEAD 간의 변경만으로 업데이트됩니다.

이것이 가능합니까? 내가 어떻게 하겠니?

답변

1

git svn documentation은 Subversion의 트렁크 작업에 대해 설명하지만, 더러운 마스터와 :

# Clone a repo (like git clone): 
    git svn clone http://svn.example.com/project/trunk 
# Enter the newly cloned directory: 
    cd trunk 
# You should be on master branch, double-check with 'git branch' 
    git branch 
# Do some work and commit locally to git: 
    git commit ... 
# Something is committed to SVN, rebase your local changes against the 
# latest changes in SVN: 
    git svn rebase 
# Now commit your changes (that were committed previously using git) to SVN, 
# as well as automatically updating your working HEAD: 
    git svn dcommit 
# Append svn:ignore settings to the default git exclude file: 
    git svn show-ignore >> .git/info/exclude 

당신이있어 대신 마스터

git checkout -b feature1 
hack ... 
git add ... 
git commit ... 

의 기능을 가지에 작업을 수행하려면 Subversion으로 작업을 다시 되돌릴 준비가되면 히스토리를 선형으로 유지하십시오.

git checkout master 
git svn rebase 
git rebase master feature1 
git checkout master 
git merge feature1 

배송하십시오!

git svn dcommit 
관련 문제