Git 命令行操作介绍

git 客户端

功能 命令 可选参数  说明

SSH

ssh-keygen

  生成密钥(注意要在~/.ssh文件夹执行,或生成后移动到.ssh)

仓库

git clone

 -b | --branch 克隆指定分支
--depth <depth> 创建一个浅克隆,克隆指定历史提交记录
--shallow-since=<date> 创建一个浅克隆,克隆指定日期的历史提交记录
git init   初始化仓库

 分支管理

git commit   提交更改到仓库
git merge   暂存区内容合并当前分支
git fetch   把远程分支最新内容拉去到暂存区
git pull   把远程分支最新内容拉去到暂存区并且合并到当前分支
git push   推送分支到远程

猜你喜欢

转载自www.cnblogs.com/WilsonPan/p/12053159.html