Search code examples
gitgit-stash

Git tagging with stash and sourcetree


I am trying to migrate from SVN to get what I understood is that

    a trunk is a master
    a tag is a Tag
    a branch is a branch

I have a lots of released versions tags that I want to move in the repo, So what I did is a new repo on the stash
    I started with version 1 revision 1 and was fine
    I used sourcetree to tag it since stash cannot tag
    Then I tried to push version 2 like this
    I pushed it as origin master
git push origin master
    I added a commit for it
    and when I try to do a git remote add for the new version I get an error

! [rejected]  master -> master (fetch first)

I don't want to mess the revision I have already and I only want push it and then tag it, I don't know what will happen if I pull i assume it will be messed up. How may I do this?


Solution

  • Don't try pushing version after version.

    Use a script like svn2git, or an even more robust tool like subgit: those will convert your SVN repo in a git repo, respecting your branches and tags.