2014-07-11 1 views
0

git을 사용하여 개발 중이지만 svn을 통해 게시해야합니다. 그게 바로 내가 git-svn (git svn clone으로)을 설정 한 이유입니다.git-svn을 사용하는 특정 로컬 (즉, 자식) 분기 만

내 평소 워크 플로우는 다음과 같이이다 :

git svn rebase # get local git repository up-to-date 
git add file # add some code 
git commit  # commit code to local git repository 
git svn dcommit # push changes from local git repository to public svn repository 

지금까지이 잘 작동합니다.

그러나 git-svn으로 완전히 무시되는 내 로컬 git 저장소에 분기 (예 : secret)를 만들고 싶습니다.

git svn rebase  # get local git repository up-to-date 
git branch secret # create secret branch in local git repository 
git checkout secret # switch to secret branch in local git repository 
git add secret.file # add some secret code 
git commit   # commit secret code to secret branch of local git repository 
git checkout master # switch back to public branch in local git repository 
git svn rebase  # get public branch of local git repository up-to-date 
git add public.file # add some public code 
git commit   # commit public code to public branch of local git repository 
git svn dcommit  # push public changes from local git repository to public svn repository 

이 워크 플로는 완전히 svn에서 숨겨진 secret.file을 유지합니다 :

은 내가 이런 식으로 뭔가를해야 할 것 같아요? 그렇다면 git mergemaster으로, git svn dcommit으로는 svn으로, 이면 ''으로 변환하면이됩니다. 그 맞습니까?

또한 master에서 public으로 이름을 바꿀 수 있습니까? 그렇다면 어떻게? 두 리포지토리의 해당 분기에 대한 기록이 이미 있습니다.

답변

1

예, 비밀 변경은 git checkout secret && git svn dcommit을 수행하거나 변경 사항을 다른 지점 (master/public)에 병합하고 거기에서 dcommit 할 때까지 로컬 git에 남아 있습니다. 대신 대중에게 마스터의 이름을 바꾸는

, 당신은 단순히 공공 시작할 수 : git checkout master git checkout -b public git commit, etc... git svn dcommit 지점 그들이에서 시작된 SVN 지점을 "기억"할 것이다, 당신은 항상 git svn info과 함께이를 확인 할 수 있습니다. 공용으로 전환 한 후에 마스터를 드롭하도록 설정할 수도 있습니다. git branch -D master

관련 문제