简体   繁体   English

使用 stash 和 sourcetree 进行 Git 标记

[英]Git tagging with stash and sourcetree

I am trying to migrate from SVN to get what I understood is that我正在尝试从 SVN 迁移以获得我所理解的

    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 我有很多已发布的版本标签,我想在 repo 中移动,所以我所做的是在 stash 上创建一个新的 repo
    I started with version 1 revision 1 and was fine 我从版本 1 修订版 1 开始,很好
    I used sourcetree to tag it since stash cannot tag 我使用 sourcetree 来标记它,因为 stash 不能标记
    Then I tried to push version 2 like this 然后我尝试像这样推送版本 2
    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 当我尝试为新版本执行 git remote add 时,出现错误

! [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?我该怎么做?

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.使用像svn2git脚本,或者像一个更强大的工具subgit :那些将转换您的SVN回购的git仓库,尊重您的分支和标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM