Git中的Stage和Unstage

Stage: 暂存区,将代码暂存到本地仓库但不上传。已经被Git跟踪的状态为stage状态,包括staging状态和staged状态。

git add .

添加当前目录下的所有文件到暂存区.


Unstage: 未被Git跟踪的状态称为Unstage状态

git reset

git reset 会将所有stage(暂存)的文件状态,都改变成非stage状。
可以使用git reset来unstage掉一些不小心加入暂存区但又与此次commit无关的文件,让你的commits保持高度的专一。

猜你喜欢

转载自blog.csdn.net/Jackson_Wen/article/details/125423700