<h1 id="git%E5%91%BD%E4%BB%A4%E4%B8%AD%E7%9A%84-%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%EF%BC%9F">git命令中的<code>--</code>是什么意思?</h1>
看到個命令 git checkout -- files
不知道--
代表什么。查了一下,--
是linux的東西,用來標志命令項的結束。有點escape的意思。
舉例:
git checkout master
上面這條命令中,master可能是一個分支也可能是一個文件.優先會作為分支來理解。如果想取出一個和分支同名的文件,就必須用下面的形式:
git checkout -- master
參考:
http://marklodato.github.io/visual-git-guide/index-zh-cn.html
http://stackoverflow.com/questions/13321458/meaning-of-git-checkout-double-dashes
http://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash
Git簡明手冊
book.pdf
git_cheat_sheet.pdf
git_magic.pdf
github-git-cheat-sheet.pdf
progit-zh.761.epub
</section>