git 常用命令

来源:互联网 发布:淘宝店招上怎么加链接 编辑:程序博客网 时间:2024/06/06 16:42

1,从已有的分支创建新的分支(如从master分支),创建一个dev分支并切换过去

     git checkout -b dev (git co -b dev)

2,创建完可以查看一下,分支已经切换到dev

   git branch (git br )

3,提交该分支到远程仓库

   git push origin dev

4.Git操作之克隆某一个特定的远程分支

  git clone -b <branch> <remote_repo> 例如: git clone -b 指定的分支名字 远程服务器的地址

5.切换分支

   git checkout 分支的名字

 Git暂存管理

git stash # 暂存

git stash list # 列所有stash

git stash apply # 恢复暂存的内容

git stash drop # 删除暂存区

0 0
原创粉丝点击