git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
williamx
V2EX  ›  git

Use '--' to separate filenames from revisions 如何翻译?

  •  
  •   williamx · Apr 9, 2016 · 3450 views
    This topic created in 3699 days ago, the information mentioned may be changed or developed.
    使用 git reset HEAD path/to/file 的时候出现这个错误。 Google 了一下,大意是说没分清操作的是 branch 还是 file ,所以操作文件的正确命令是`git reset -- path/to/file`。
    但是上面那个提示是什么意思? revisions 在这里该怎么理解?
    3 replies    2016-04-10 09:13:36 +08:00
    qq529633582
        1
    qq529633582  
       Apr 9, 2016   ❤️ 1
    "用`--`分割文件名和版本号"

    "--"之前是可以指定一个版本(如 commit 、 branch 等)的,如`git reset a1b2c3d -- path/to/file`,你这里没有指定就用 HEAD 咯
    mcfog
        2
    mcfog  
       Apr 10, 2016
    revision n.修订

    “修订”是版本库中记录的一组修改/一个状态,每提交一次就会产生一个 revision

    对 git 来说, commit hash 、 branch 、 tag 以及 HEAD 等都可以用来指代一个 revision
    williamx
        3
    williamx  
    OP
       Apr 10, 2016
    感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1183 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 17:50 · PVG 01:50 · LAX 10:50 · JFK 13:50
    ♥ Do have faith in what you're doing.