您的位置:首页 > 其它

git创建和删除远程分支

2013-11-05 13:12 337 查看
问题描述:

          使用git创建和删除远程分支

问题解决:

             (1)git创建本地分支





注:   

        如上所示,使用命令 git branch -a 查看所有分支情况,以及当前分支

         使用命令git branch temporary 创建分支temporary

         使用命令 git checkout temporary 切换到temporary分支

     (2)git创建远程分支





注:

         如上所示,在本地分支 temporary中创建文件 并commit之后,创建远程分支 git   push  origin  temporary:temporary

      其中origin是远程仓库,第一个temporary是本地分支,第二个temporary是远程新建的分支(github中为例子)





注:

       如上图所示  temporary是刚才创建的远程分支

    (3)删除远程分支

           1)使用命令 git  push origin --delete 远程分支名   





注:

      使用命令  git    push   origin --delete hello (hello为远程分支名称)





注:

         github中删除远程分支hello之后效果图

       2)使用命令  git   push origin  :temporary





注:

        使用命令  git   push origin  :远程分支名





注:

          删除远程分支之后的效果图
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐