git常用命令 ,竖线左侧是zsh命令,右侧是git命令

复制其他分支的文件夹或文件

git checkout [分支名称] -- 路径
git checkout origin/test -- aa/bb/aa.js 

单独拉取一个commit记录

git cherry-pick -x [commit的id]

查看git配置

gcf  |    git config --list

查看git 记录


/*一般glol(每条记录信息最详细)和glg(展示多条记录)配合使用 */
glog   |   git log --oneline --decorate --color --graph
/*一行简短文字,包括tag版本号、commit记录所在的分支*/


glg  |    git log --stat --color
/*信息比较详细,每次展示的少,显示完整的commitID,提交人(邮箱),修改的文件,修改的文件数量等,算是最详细的了*/


glol |  git log --graph --pretty = format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
/*显示分支名称,commit文字,commitID,时间,提交人*/

操作分支

/* 切换分支*/
gco  [branchName] |  git checkout out [branchName]

/*新建分支*/
gcb  [newBranch]  |  git checkout -b [newBranch]

/*查看所有分支*/
gba  |  git branch -a

你可能感兴趣的:(git常用命令 ,竖线左侧是zsh命令,右侧是git命令)