美文网首页
GIT 推送本地分支到远程,删除远程分支

GIT 推送本地分支到远程,删除远程分支

作者: 躺在家里干活 | 来源:发表于2019-10-16 18:43 被阅读0次

    推送本地分支到远程

    # sparrow @ MacBook-Pro-2 in ~/Documents/deveploment/project/* on git:wangyanan_1016_subquery x [11:33:22] C:1
    # 新建分支
    $ git branch test
    
    # sparrow @ MacBook-Pro-2 in ~/Documents/deveploment/project/* on git:wangyanan_1016_subquery x [11:33:28] 
    # 检出分支
    $ git checkout test 
    Switched to branch 'test'
    
    # sparrow @ MacBook-Pro-2 in ~/Documents/deveploment/project/* on git:test x [11:33:40] 
    $ git push
    fatal: The current branch test has no upstream branch.
    To push the current branch and set the remote as upstream, use
    
        git push --set-upstream origin test
    
    
    # sparrow @ MacBook-Pro-2 in ~/Documents/deveploment/project/* on git:test x [11:33:42] C:128
    $ git push --set-upstream origin test
    Total 0 (delta 0), reused 0 (delta 0)
    remote: 
    remote: To create a merge request for test, visit:
    remote: 
    To gitlab.*.com:xingren/*.git
     * [new branch]            test -> test
    Branch 'test' set up to track remote branch 'test' from 'origin'.
    

    删除远程分支

    # sparrow @ MacBook-Pro-2 in ~/Documents/deveploment/project/* on git:test x [11:33:58] 
    $ git push origin --delete test
    To gitlab.*.com:xingren/*.git
     - [deleted]               test
    

    个人博客

    相关文章

      网友评论

          本文标题:GIT 推送本地分支到远程,删除远程分支

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