随便记些常用的git命令
git提交代码
git add . 提交暂存区
git status 查看有变更的文件
git commit -m "注释"
git push 提交远程仓库
git pull 刷回最新代码
git分支管理
git branch 查看本地所有分支
git branch -r 查看远程所有分支
git branch -a 查看所有分支
git merge 【待合并分支】 将某分支合并到master
git push origin master 将合并后的代码推送到远程分支
git版本回滚
git checkout 检查当前分支
git checkout [file] 恢复暂存区文件
git log 查看提交版本
git revert 【版本号】 将本地库回滚到该版本号之前的版本(即撤回该版本及之后的提交)
你应当热爱自由!
作者:Leejk,转载请注明原文链接:https://www.cnblogs.com/leejk/p/15007436.html