一、git 解決fatal: Not a git repository
我用git add file添加文件時出現這樣錯誤:
fatal: Not a git repository (or any of the parent directories): .git
提示說沒有.git這樣一個目錄,解決辦法如下:
git init就可以了!
二、warning: You appear to have cloned an empty repository
三、修改git已經commit的郵箱和用戶名
第一步:前往需要修改的版本
1、使用 git log 獲取需要修改的版本id
2、使用 git reset –soft [版本號] 前往版本
第二步:修改信息
使用 git commit --amend --author='用戶名 <郵箱>'修改
在打開的文件中保存一下就可以了
第三步:提交代碼
使用 git push
四、git分支代碼報錯
git clone master
git checkout 分支
然后就可以了