git相关命令

1、新建本地分支  

  git checkout -b uc-gateway-account-zly

2、查看分支状态  

  git branch

    D:\workspace\AutoTest>git branch
    feature-autotest
    master
    onlinebranch
    * uc-gateway-account-zly             

  *表示当前分支 并且现在的状态是成功创建的新的分支并且已经切换到新分支上

3、新建的本地分支push到远程服务器  

   git push originuc-gateway-account-zly:uc-gateway-account-zly 

4、使用git branch -a查看所有分支,会看到remotes/origin/uc-gateway-account-zly这个远程分支,说明新建远程分支成功

5、删除远程分支

  git push origin --delete uc-gateway-account-zly

6、把本地分支和远程分支关联起来  

  git branch --set-upstream-to=origin/uc-gateway-account-zly uc-gateway-account-zly

 

posted @ 2020-09-30 15:34  琥珀呀  阅读(77)  评论(0编辑  收藏  举报