簡體   English   中英

Git簽出…不簽出文件

[英]Git checkout … doesn't checkout files

我試圖通過刪除流星應用程序的整個目錄來查找編譯時錯誤(請參閱流星編譯-錯誤輸出未顯示錯誤在哪里? )。

所以我嘗試了類似刪除(client)和(server)目錄的操作,以了解錯誤的位置:

$meteor
=> compile time mistake
$rm -rf ./client/*
$meteor
=> compile time mistake
$rm -rf ./server/*
$meteor
=> compile time mistake
$rm -rf ./api/*
$meteor
=> compile time mistake

一旦發現錯誤是在api上,我便嘗試再次檢查我的上一次提交,但文件沒有回來!

$ git branch
  erreur
* extra_erreur
  master
$ git checkout extra_erreur
D   client/cb.html
D   client/cb.js
D   client/choix_page.html
D   client/choix_page.js
D   client/hello.html
D   client/hello.js
D   client/home.html
D   client/home.js
D   client/ligne_produit.html
D   client/ligne_produit.js
D   client/main.css
D   client/main.html
D   client/main.js
D   client/menu.html
D   client/menu.js
D   client/navbar.html
D   client/navbar.js
D   client/restaurants.html
D   client/restaurants.js
D   client/subscribe.html
D   client/subscribe.js
D   client/templates.html
Already on 'extra_erreur'
$ cd client/
$ ls
$ 

我必須回到(master),然后回到(extra-erreur)才能將它們放回原處:-/

$ git checkout master
D   client/choix_page.html
D   client/choix_page.js
D   client/hello.html
D   client/hello.js
D   client/home.html
D   client/home.js
D   client/main.css
D   client/main.html
D   client/templates.html
Switched to branch 'master'
Your branch is ahead of 'dorj/master' by 3 commits.
  (use "git push" to publish your local commits)
$ git checkout extra_erreur
D   client/choix_page.html
D   client/choix_page.js
D   client/hello.html
D   client/hello.js
D   client/home.html
D   client/home.js
D   client/main.css
D   client/main.html
D   client/templates.html
Switched to branch 'extra_erreur'
$ ls
client      common      imports     node_modules    package.json    server
$ cd client/
$ ls
cb.html         ligne_produit.html  main.js         menu.js         navbar.js       restaurants.js      subscribe.js
cb.js           ligne_produit.js    menu.html       navbar.html     restaurants.html    subscribe.html

我不明白:-('D'是什么意思?

git checkout -- client server api僅那些目錄的git checkout -- client server api

要么

git checkout -- . 為了一切

Git可能會非常混亂,其命令的工作方式和采用參數的方式可能會不一致。 話雖如此,我敢肯定在幫助頁面和谷歌搜索之間,我確定您可以自己解決這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM