[clug] Git help please - I might be breaking branches

David Tulloh david at tulloh.id.au
Mon Mar 23 02:51:11 GMT 2009


Alex Satrapa wrote:
> Working on tickets in Trac, I've been doing this:
>
>> # Have you ever danced with Subversion by the pale moonlight?
>> git svn fetch
>> git svn rebase
>> git svn dcommit
>>
>> # At this point I expect my SVN and git repositories are in sync.
>> # I have a ticket #123 that I want to work on
>>
>> git checkout -b ticket-123
>>
>> # do stuff to fix the problem reported in ticket-123
>> git add <stuff that changed>
>> git commit -m "Changed stuff. Fixes #123."
>>
>> git switch svn-trunk
>> git merge ticket-123
>>
>> # Dance with SVN again
>> git svn fetch
>> git svn rebase
>> git svn dcommit
>>
>> # At this point I have the repositories in sync again, the ticket
>> # in Trac was closed during the post-commit hooks on Subversion,
>> # and the world is happy... almost:
>>
>> git branch
>>
>> svn-trunk
>> ticket-1
>> ticket-2
>> ticket-3
>> ...
>> ticket-123
>
> When I try to delete the branch, I get this:
>
>> [alex at here]# git branch -d ticket-123
>> error: The branch 'ticket-123' is not an ancestor of your current HEAD.
>> If you are sure you want to delete it, run 'git branch -D ticket-119'.
>
> Now while I'm sure that I want to delete ticket-123, and I'm
> absolutely certain that the changes incurred by ticket-123 have been
> merged into svn-trunk and are working ... what have I done (or not
> done) that is causing git to freak out?
I'm not familiar with the git-svn magic, but the vanilla git
incantations look ok (I assume git switch should have been git checkout).

Of the svn commands the rebase line looks most suspicious.


Gitk is a very nice tool for seeing your history.  You should be able to
see your tree and where all your branches are merged in.  I would
recommend using gitk as you go through each step to see exactly what is
happening with your branches and where it goes awry.


David


More information about the linux mailing list