第一次用git,遇到這個錯誤提示,原來是這樣的:
fatal: Not a git repository (or any of the parent directories): .git
This tells you that the directory you're in is not a git repository. Before you can add remote servers, commit things and so you must have a git repository created.
In a git repository there's a directory (which can be hidden) named .git. It contains metadata on the repository and all the data regarding the checked files.
To create it type git init in the directory you wish to have a git repository. Then you could add remote servers and perform operations on it.
1.fatal: Not a git repository (or any of the parent directories): .git
出現這個問題後,發現其實是在本系統下沒有找到一個.git這樣的目錄,所以在終端下使用git --help命令,顯示了其主要的一些命令參數,發現一個參數是init:
2.init Create an empty git repository or reinitialize an existing one
執行git init之後,然後再重新編譯,這個問題就被解決了。這裡要注意的一點是,和svn不一樣,svn不需要自己使用命令來建立自己的資產庫,而git需要自己使用命令手動建立,具體.git的位置和你在哪個目錄下執行命令有關。