git-svn: reset tracking for master

后端 未结 6 1108
自闭症患者
自闭症患者 2020-12-04 16:51

I\'m using git-svn to work with an SVN repository. My working copies have been created using git svn clone -s http://foo.bar/myproject so that my w

6条回答
  •  [愿得一人]
    2020-12-04 17:23

    If you git svn rebase after switching back to master and use --squash you can avoid this.

    # git checkout master
    # git svn rebase   //(<--the missing step)
    # git merge --squash mybranch // (<-- doesn't commit, more like an svn merge would do)
    ... (successful)
    # git add . 
    # git commit -m '...' 
    # git svn dcommit
    Committing to http://foo.bar/myproject/trunk...
    #
    

    To solve the current state (i.e. your master is pointing to an SVN branch)

    You can 'switch' to another branch, delete master, 'switch' back to it and then merge again:

    # git checkout mybranch
    # git branch -D master
    # git checkout -b master trunk
    ... continue with merge...
    # git merge --squash mybranch
    

    ... you now have mybranch merged into master and ready to commit and then dcommit to trunk

提交回复
热议问题