unlink git branch from svn origin -
this question has answer here:
this follow-up this previous question. there can find did far.
in short, created new git
branch branching branch dcommit'ed remote svn
repository. new git
branch intended used locally , never synchronized svn
. while can ensure manullay explained in this answer, new git
branch 'remembers' svn
origin:
$ git svn info path: . url: [path-to-host]/[svn-repo]/trunk repository root: [path-to-host]/[svn-repo] repository uuid: [repository-uuid] revision: [revision] node kind: directory schedule: normal last changed author: sg-lecram last changed rev: [revision] last changed date: [date]
so assume if checkout new git
branch , commit changes local git
, run git svn dcommit
sending changes svn
. while not plan this, needs forget split-second on branch on publish secret changes in secret git branch.
i able unlink new git
branch svn
trying dcommit branch results in error. how can this?
you can't. git-svn finds associated subversion repository searching history commit message containing git-svn-id: ...
line reference subversion commit recorded in git-svn's history. once arrives @ commits subversion-tracking branch, find one.
i'd suggest alias git
script hooks svn dcommit
, , checks whether in correct branch before passing on real git
command. while requires modify system outside repository, far simplest solution.
all technical options can think of require prevent git-svn reading far history:
- create second svn repository, add second svn remote, checkout it, , create empty commit in branch containing reference line checkout. afterwards, delete svn repository. trying dcommit in branch try use other svn server , therefore fail.
- work orphan branches. if checkout new branch using
git checkout --orphan new_branch_name
, have disjoint history , therefore not have commit messages valid references svn.
with both solutions, merging work branch parent branch more involved usually. first option, branch again branch , rebase -i
against master skipping first commit, pull master. second 1 rebase
--onto master
, upstream
set root commit of branch.
Comments
Post a Comment