(用于提示自己)
做出改动时(修改),可以直接添加改动git add . and -am "add",也可以查看状态git status,git bash判断是否有改动,没有则提示无改动,有则提供几种方案:
1.更改工作区的修改状态以达到没有改动要提交到暂存区(改变工作区以达到工作区与暂存区一致的状态):
Changes not staged for commit:
(use "git add <file>..." to update what will be committed) 添加改动git add .
【若改动为删除,则此提示变为(use "git add/rm <file>..." to update what will be committed)】添加此改动到暂存区,提示Changes to be committed: (use "git reset HEAD <file>..." to unstage)撤回添加改动到暂存区,退回到上一层判断;或删除暂存区中与工作区同名的文件(同步了两个区域)
(use "git checkout -- <file>..." to discard changes in working directory)撤回改动git checkout -- to_be_motify.txt(从暂存区恢复此文件)
2.将暂存区转变为未改动状态(改变暂存区以达到工作区与暂存区一致的状态):
no changes added to commit (use "git add" and/or "git commit -a")
确认改动git add .然后注释改动git commit -am "motify",或git commit -a以vim打开记录文件,在里面键入注释
网友评论