Git备忘

作者: 已经是咸鱼的小涛orz | 来源:发表于2017-07-25 18:25 被阅读0次

    用户信息

    git config --global user.name "penghaitao"
    git config --global user.email penghaitao918@163.com
    

    新项目

    git init
    git add *
    git commit -m "first commit"
    git remote add origin https://github.com/penghaitao918/PROJECT.git
    git push -u origin master
    

    分支操作

    • 上传某个本地tag
    git push origin [tag_name]
    
    • 上传本地所有tag
    git push origin --tags
    

    Error

    dst refspec xxxx matches more than one. failed to push some refs to a http://xxxxxxx

    当远程仓库同时存在相同名称的 branch 和 tag 时,不指明绝对路径的前提下,操作这个名称的 branch 和 tag 都会出现这个问题。

    //删除dev_test 分支
    git push origin :refs/heads/dev_test
    
    //删除dev_test 标签
    git push origin :refs/tags/dev_test
    

    相关文章

      网友评论

          本文标题:Git备忘

          本文链接:https://www.haomeiwen.com/subject/kikgkxtx.html