簡體   English   中英

為什么我會致命:文件來自Jenkins的存儲庫

[英]Why am I getting fatal: file is outside repository from Jenkins

我試圖在Jenkins工作中推送Git上的文件:

在JENKINS中我添加了一個Windows shell命令作業,這是第一個命令:

git add "C:\Users\AMRABET\Documents\VSC\HW\index.html" 

但是我收到以下錯誤:

fatal: C:\Users\AMRABET\Documents\VSC\HW\index.html: 'C:\Users\AMRABET\Documents\VSC\HW\index.html' is outside repository

相同的命令適用於Windows CMD。 它適用於Windows。 我的問題不同,因為我只在詹金斯得到它

有幫助嗎?

正如評論中所建議的那樣,我剛剛退出git倉庫。

實際上在Jenkins你做的時候

cd C:\Location
AnotherShellAction
git add RandomFile

git動作不會從你提到的C:\\ Location執行,而是從默認工作區執行。 這意味着您需要在每條指令后再次輸入所需的位置。 那么好的方法是:

cd C:\Location
AnotherShellAction
cd C:\Location
git add RandomFile

暫無
暫無

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

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