我試圖從與我所在的目錄不同的目錄中運(yùn)行g(shù)it。例如,如果我位于:cd /home/domain/git status << runs perfect ie# On branch master# Your branch is ahead of 'origin/master' by 6 commits.因此,現(xiàn)在我想使用該--git-dir選項(xiàng)從其他目錄運(yùn)行此命令。因此,可以說(shuō)我正在root/嘗試以下方法:git --git-dir="/home/domain/" status## Error fatal: Not a git repository: '/home/domain/'我也試圖包括.git文件夾,即git --git-dir="/home/domain/.git/" status但這似乎是試圖從根目錄運(yùn)行g(shù)it,即從我的域文件夾中刪除所有內(nèi)容并在root中添加所有內(nèi)容。希望有人可以建議我做錯(cuò)了什么。
git --git-dir不能按預(yù)期工作
桃花長(zhǎng)相依
2019-11-06 10:15:50