Git 操作笔记

less than 1 minute read

Status of file

The status of file

Relation between Work Space and Version Base

Local Structure of Git

Instruction for Backtrace

git rm --cached <file> :to remove file in staged zone

git checkout -- <file> modified file (which has not been add to staged zone), can use this instruct to trace back

git reset HEAD <file> 上一条命令是在未执行 git add 命令便修改文件生效并放入暂存区,可使用 git checkout 命令。那么如果不慎已经执行了 git add,则可使用本命令。再对需要恢复的文件使用上一条命令即可。

git clean <file> -f 如果你的工作区混入了未知内容,你没有追踪它,但是想清除它的话就可以使用本命令,它可以帮你把未知内容剔除出去。

Branch

git branch <branch-name>
create a branch base on current branch, and change to the new branch

git branch -D[d] <branch-name>
delete a branch . (D for complusively)

git branch -a
list all branches

git checkout <branch-name>



Afdafczl

Afdafczl

BUAA, School of Software, Sophomore 这是一个属于Afdaf的,基于Github Page搭建的个人博客,用于记录与查看个人学习笔记。 可点击左侧导航栏查看详情

Comments

  Write a comment ...