Git 常用的指令

基本指令

// 设置别名
$ git config --global alias.st status

// 创建代码库
$ git init

// 用户配置
$ git config --global user.name yourname
$ git config --global user.email youremail

// clone 远程仓库项目
$ git clone "仓库的 SSH url"

// 查看当前状态
$ git status

// 提交缓存区
$ git add 目录 | 文件 | .( . 代表目录下的全部文件)

// 提交修改
$ git commit -m "提交说明"

// 拉取指定仓库到本地本分支
$ git pull origin

// 合并某分支到当前分支
$ git merge --no-ff -m "合并描述"

// 提交远程仓库
$ git push origin master

分支管理

// 查看分支
$ git branch

// 删除分支
$ git branch -d

// 强行删除分支
$ git branch -D

// 创建分支
$ git branch

// 切换分支
$ git checkout

// 创建并切换
$ git checkout -b

你可能感兴趣的:(Git 常用的指令)