標籤:http io os 使用 ar for strong 檔案 sp
1-- clone分支,修改檔案本地commit後, push回原分支失敗,報錯:
git push
[email protected]‘s password:
Counting objects: 21, done.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1010 bytes, done.
Total 11 (delta 9), reused 0 (delta 0)
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
error: is denied, because it will make the index and work tree inconsistent
error: with what you pushed, and will require ‘git reset --hard‘ to match
error: the work tree to HEAD.
error:
error: You can set ‘receive.denyCurrentBranch‘ configuration variable to
error: ‘ignore‘ or ‘warn‘ in the remote repository to allow pushing into
error: its current branch; however, this is not recommended unless you
error: arranged to update its work tree to match what you pushed in some
error: other way.
error:
error: To squelch this message and still keep the default behaviour, set
error: ‘receive.denyCurrentBranch‘ configuration variable to ‘refuse‘.
To git+ssh://[email protected]/media/LINUXDATA/working
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to ‘git+ssh://[email protected]/media/LINUXDATA/working‘
參照如下連結,目標repo中執行 $ git config ‘receive.denyCurrentBranch‘ warn 後OK
http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked
2-- 新增檔案add commit後,push回原分支失敗,報錯:
Counting objects: 20, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1.30 KiB, done.
Total 11 (delta 5), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects
參照如下連結,查看原repo .git目錄許可權,發現.git/object/沒有group寫入權限導致;執行 $ sudo chmod g+w -R .git/object 後OK
http://stackoverflow.com/questions/6448242/git-push-error-insufficient-permission-for-adding-an-object-to-repository-datab
3-- git clone/git clone --bare/git clone --mirror 區別
http://stackoverflow.com/questions/3959924/whats-the-difference-between-git-clone-mirror-and-git-clone-bare
4-- does not appear to be a git repository
這種問題,許可權問題居多,看看整個repo目錄 全路徑上面使用者、組權許可權,是否允許訪問
[轉]git使用問題-解決方案 備忘