天天看點

第一次上傳代碼到github (Linux)

1    初始化 執行git init 

第一次上傳代碼到github (Linux)

2   克隆

找到倉庫位址,在github的具體項目上有

執行 git clone <位址> 并且把需要上傳的檔案拷貝過去

第一次上傳代碼到github (Linux)

3  添加送出檔案 git add *   即添加所有變動的

第一次上傳代碼到github (Linux)

4 送出 git commit -m "描述"

第一次上傳代碼到github (Linux)

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"

  git config --global user.name "Your Name"

to set your account's default identity.

Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got '[email protected](none)')

  git config --global user.email "[email protected]"

 git config --global user.name  "usrname"

5 push到遠端(伺服器) git push origin master

第一次上傳代碼到github (Linux)

看到出錯了,403 403錯誤,則請編輯 .git/config檔案

第一次上傳代碼到github (Linux)

把紅線的地方修改為    即在github前面加上 [email protected] (  url = https://[email protected]/username/repository.git )

第一次上傳代碼到github (Linux)

重新git push origin master

第一次上傳代碼到github (Linux)

執行unset SSH_ASKPASS 參考 http://stackoverflow.com/questions/16077971/git-produces-gtk-warning-cannot-open-display

第一次上傳代碼到github (Linux)

重新git push origin master    此時輸入密碼就ok了

第一次上傳代碼到github (Linux)
git