Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify the index-zh-cn.html, change the description of 'git checkout -- files' #60

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mygaochunming
Copy link

@mygaochunming mygaochunming commented Jun 13, 2017

  • git checkout -- files 把文件从暂存区域复制到工作目录,用来丢弃本地修改。如果本地修改后没有添加到暂存区,则丢弃本地修改回到和版本库一模一样的状态
  • git commit -a 针对版本库中存在的文件,相当于运行 git add,把所有当前工作区目录下的相应文件加入暂存区域再运行 git commit。对于新建的文件,不能通过该命令直接将文件从工作区提交至版本库。
  • “git reset -- files”和“git checkout -- files”用法很不一样! git reset -- files强调将暂存区的文件内容回滚至最后一次提交,不会动工作区的修改。 git checkout -- files强调回滚工作区的修改,不管从暂存区还是版本库中。
  • @mygaochunming
    Copy link
    Author

    mygaochunming commented Jun 13, 2017

    1、上面那个图不知道怎么修改……
    2、是不是checkout -- files,如果发现暂存区改file没有修改,就转换为checkout HEAD -- files?

    “git reset -- files”和“git checkout -- files”用法很不一样!
    git reset -- files强调将暂存区的文件内容回滚至最后一次提交,不会动工作区的修改。
    git checkout -- files强调回滚工作区的修改,不管从暂存区还是版本库中。
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant