竹磬网-邵珠庆の日记 生命只有一次,你可以用它来做些更多伟大的事情–Make the world a little better and easier

811月/118

Git初始化错误小记

在第一次 git clone ssh://project_ip/git/project.git 時候,一直發生 fatal: no matching remote head 錯誤訊息,

根據 G 大師開示,解決方法是:

在第一次專案建立時,Client 端的指令:

mkdir test 
cd test
git init 
touch .git/git-daemon-export-ok
git remote add origin ssh://project_ip/git/project.git
touch index.html
git add index.html
git commit -m "init"
git push origin master

讓 project 內有檔案,而其他電腦的 client 部份,直接 git clone 就沒有問題。

之后只使用git push就可以了

 

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

    branch.master.remote = <nickname>
    branch.master.merge = <remote-ref>
    remote.<nickname>.url = <url>
    remote.<nickname>.fetch = <refspec>

请使用:


git config branch.master.remote origin  
git config branch.master.merge refs/heads/master 

喜欢这个文章吗?

考虑订阅我们的RSS Feed吧!

发布在 邵珠庆

评论 (8) 引用 (0)
  1. I hope or dress comes out looking decent, if not imma be mad..!

  2. You ought to seriously moderate the responses on this internet site


取消回复

还没有引用.