git 常用命令

来源:互联网 发布:齐鲁证券网上交易软件 编辑:程序博客网 时间:2024/06/06 03:04

init

usage: git init [-q | –quiet] [–bare] [–template=] [–shared[=]] []

--template <template-directory>                      directory from which templates will be used--bare                create a bare repository--shared[=<permissions>]                      specify that the git repository is to be shared amongst several users-q, --quiet           be quiet--separate-git-dir <gitdir>                      separate git dir from working tree

git clone

  • git clone <版本库的地址> 从版本库地址克隆工程到当前目录
  • git clone <版本库的地址> [本地目录名] 从版本库地址克隆工程到指定的本地目录

git push

  • git push [远程名] [本地分支名]:[远程分支名] 将本地分支推送至远程名下的远程分支名
    git push origin master:Test 将本地master分机推送到origin下的Test分支下,若origin无Test分机则创建Test分支
    git push origin :Test 将删除origin下的Test分支
0 0