1. 程式人生 > >【git】fatal: This operation must be run in a work tree

【git】fatal: This operation must be run in a work tree

今天新建立一個工程,需要一個倉庫。

用git --bare init建立的empty的倉庫,不能git add,

會會報錯fatal: This operation must be run in a work tree 。

但是,據說用git init的可以。

解決辦法有幾個,

===============

我選用的是:

倉庫用git --bare init,

而我的實際的工程目錄下用git init,git remote add origin ,git add 某個檔案,git commit ,git push之後,

遠端的倉庫就ok了。

用gitweb也可以順利的看到。

==================

相關推薦

gitfatal: This operation must be run in a work tree

今天新建立一個工程,需要一個倉庫。 用git --bare init建立的empty的倉庫,不能git add, 會會報錯fatal: This operation must be run in a work tree 。 但是,據說用git init的可以。 解決

Git初學使用記錄fatal: this operation must be run in a work tree解決辦法

fatal: this operation must be run in a work tree $ git add test.txt fatal: this operation must be run in a work tree 解決辦法 原因是我們把t

[git] fatal: This operation must be run in a work tree

換了臺新電腦,然後重新安裝了最新版本的Git Extension。 然後新建Git Repo 然後就遇到了這個問題 WTF, 以前沒見過 好吧,各種上網查資料,折騰半天沒解決 後來在Stack Overflow上面找到答案 對的,我的目錄錯了,WTF 對,

[git] fatal: This operation must be run in a work tree

        在使用git  init --bare 進行建立裸倉庫之後,在使用git 其它的命令都會出現fatal:This operation must be run in a work tree 問題,處理方法:         先touch readme 因為在建

Gitfatal: Authentication failed for ... 修復經驗

正常情況下git clone或者git push xxx都是應該沒問題的,或者不需要輸入密碼,或者輸入密碼就能執行。 但昨晚遇到了如圖這樣的問題↓ eclipse執行git pull命令後修復衝突了還是無法提交轉而用命令列操作的時候遇到這個問題。 百度

gitGit 提示fatal: remote origin already exists 錯誤解決辦法

遠程 分享 mage mod dal -s lock 解決 ack 今天使用git 添加遠程github倉庫的時候提示錯誤:fatal: remote origin already exists. 最後找到解決辦法如下: 1、先刪除遠程 Git

error: index-pack died of signal fatal: index-pack failedGit

error: index-pack died of signal fatal: index-pack failed 環境: 克隆Linux原始碼時發生錯誤 git clone https://github.com/torvalds/linux.git error: index-pack died

Errorfatal: Unable to create '.../.git/index.lock':

使用git add時遇到錯誤: fatal: Unable to create '/Volumes/APFS-case-sensitive/Tech/Pwn/[email protected]/.git/index.lock': File exists. Another gi

git用http協議git clone程式碼出現fatal: I don't handle protocol

無論怎麼操作,都會報這個錯誤提示: [[email protected] dw]$ git clone http://gitlab.gbcom.com.cn/dw/dw 正克隆到 'dw'... fatal: I don't handle protocol '/h

git如何去解決fatal: refusing to merge unrelated histories

allow 版本 ref 新的 新建 -- 本地 -h git pull 我在Github新建一個倉庫,寫了License,然後把本地一個寫了很久倉庫上傳。 先pull,因為兩個倉庫不同,發現refusing to merge unrelated histories,無法

MongoDBThe basic operation of Index in MongoDB

drop desc ould lar text and tracking num ack In the past four blogs, we attached importance to the index, including description and c

Git常見錯誤提示解決辦法和常用方法

log image 解決 遠程 添加 logs 遠程倉庫 錯誤 ima 1.添加遠程倉庫時提示fatal: remote origin already exists. 先刪除遠程倉庫,再添加遠程倉庫 最後再push 2.修改本地文件(比如README.md)後,更新到g

計算幾何bitsetGym - 101412G - Let There Be Light

bit pen urn 接受 eset iostream scan || names 三維空間中有一些(<=2000)氣球,一些光源(<=15),給定一個目標點,問你在移除不超過K個氣球的前提下,目標點所能接受到的最大光照。 枚舉每個光源,預處理其若要照射到光源

Git二、安裝配置

config 查看 projects set col utl font ssl user 一、Git安裝   Linux 1 $ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext 2 libz-dev

gitPorcelain and Plumbing

bin level eve 好用 bsp 要去 概念 proc 的人 git裏面有這兩個對立的概念 考慮一個管道系統 Porcelain意思是陶瓷的,好比說洗臉池,坐便器這樣。用戶能直接用的,非常好用的東西,叫Porcelain。 相比之下底層的東西就是水管,最

GITGit Flow最佳實踐

【GIT】Git Flow最佳實踐

gitgit分支的合並

stat diff 出錯 傳輸 .html read 簡單 流程 保存 原文: http://gitbook.liuhui998.com/3_3.html http://gitbook.liuhui998.com/5_3.html 一、如何分支的合並 在gi

gitgit add 添加錯文件 撤銷

strong 可能 git reset status reset 表示 其他 多余 如果 git add 添加 多余文件 這樣的錯誤是由於, 有的時候 可能 git add . (空格+ 點) 表示當前目錄所有文件,不小心就會提交其他文件 git add 如果添加了錯誤的

初始化本地項目到遠程倉庫git

span clone 地址 tle style clas 基本 部分 col 大部分情況,都是從遠程倉庫clone項目,步驟很簡單。 今天要把本地項目初始化到遠程倉庫的步驟記錄下來,其實也很簡單,幾步就好: #初始化本地倉庫 git init #將本地內容添加至git索引

GitGitHub的SSH提交配置[

Go src 賬號密碼 方便 不能 cnblogs 郵箱 如果 們的 Git可以通過https方式和ssh方式連接服務器上的倉庫。 兩者比較: 1.https: 比較方便,但是每次fetch和push代碼都需要輸入賬號和密碼,略顯麻煩 2.ssh: 傳輸前壓縮數據,傳輸效