簡體   English   中英

在Windows上使用Git更新文件

[英]Update file with Git on Windows

我最近安裝了Git,我正在嘗試使用此命令更新文件:(在Windows 7上)

git add Probe.txt

但它說“ 致命:pathspec'探測'與任何文件都不匹配 ”我在文件所在的目錄中。 事實上,如果我嘗試git status我會得到“ modified:Probe.txt ”。

我該如何更新我的文件?

試試git add . 這將添加一切。 不知道為什么特定的文件名不起作用,但這絕對應該。

看起來你實際上是因為某種原因在“探測”之后進入了一個空間,觀察:

~% cd /tmp
/tmp% mkdir foo
/tmp% cd foo
foo% git init
Initialized empty Git repository in /tmp/foo/.git/
foo% git add probe .txt
fatal: pathspec 'probe' did not match any files
foo%

我目前不在Windows上,但我認為你可以得到這個想法。

如果您確定不是這樣,請在設置后重新嘗試命令

set GIT_TRACE=1

並通過git add Probe.txt的輸出更新您的問題,以便我們進一步猜測。

暫無
暫無

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

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