# GitPractise **Repository Path**: BaiYang-007/git-practise ## Basic Information - **Project Name**: GitPractise - **Description**: Just Practice Git - **Primary Language**: C++ - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-01-17 - **Last Updated**: 2025-01-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GitPractise #### 介绍 Just Practice Git **原来切换分支后,工作目录也会跟着更新变化** (Pull Request,简称 PR) ```cpp **查看差异** git diff 暂存区和未暂存的工作区域对比 git diff --cached / git diff --staged 暂存区和上次提交作对比 git diff SHA1 SHA2 两次提交作对比 **查看log日志** git log -p git log --stat git log --graph **撤销暂存** git reset file / git reset HEAD file **撤消对文件的修改** git checkout -- file **分支** git branch testing git branch -d testing / git branch -D testing git checkout testing / git checkout -b testing **拉取 git pull** 然而,有一个命令叫作 git pull 在大多数情况下它的含义是一个 git fetch 紧接着一个 git merge 命令。 **回退提交** git reset --soft HEAD~ ``` ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/ae9ca5cb-2c6f-48e8-a693-56b167cc796a/4977853a-5472-4517-8e4d-925bf80fb893/image.png) **Git 三棵树** ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/ae9ca5cb-2c6f-48e8-a693-56b167cc796a/e263859b-068c-49c2-90cb-a52278fe3fcf/image.png)