[轉]git使用問題-解決方案 備忘

來源:互聯網
上載者:User

標籤: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使用問題-解決方案 備忘

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.