Git命令
2020-11-14 本文已影响0人
爱吃的H先生
git init-------初始化仓库
git add Demo.txt ------讲文件名为Demo.txt放入暂存区
git commit -m "这是我提交的第一个文件" Demo.txt ---------讲Demo.txt文件从暂存区提交到远程仓库
git status-------查看文件提交状态
git log-------查看文件提交历史记录
git log --pretty=oneline ------将历史记录以一行展示

git log --oneline --------------将历史记录以一行展示

git reflog ----------------将历史记录以一行展示

git reset --hard 10433a4 -----版本回退到10433a4这个版本
git diff Test3.txt-----------比较Test3.txt不同之处
git diff----------- 比较所有文件不同之处
git diff +历史版版本+文件名------------------比较该文件当前版本和历史版本的不同之处
git branch -v -----------查看分支信息

git branch branch01 -----------创建名为branch01的分支

git checkout branch01--------------切换到branch01分支

git merge 分支名称------------将分支内容合并到主分支