終於搞定了github,寫個成功的備忘錄.

  1. 創建項目,進入項目文件夾
  2. 初始化ssh key 參見官網指南.(本機生成一對key,public key傳到官網sshkey下面)
    https://help.github.com/articles/generating-ssh-keys/
  3. 初始化用戶名,郵箱git

    $ git config --global user.name "defnngj"//給本身起個用戶名
    $ git config --global user.email "defnngj@gmail.com"//填寫本身的郵箱github

  4. git initshell

  5. git add .windows

  6. git commit -m "message for this commit"服務器

  7. touch README.md網絡

  8. git add README.mdssh

  9. git status網站

  10. 去github網站創建一個repo 如"ts.git"this

  11. git remote add origin git@github.com:wuzhuzhu/ts.git
    若是遇到了fatal: remote origin already exists.輸入:rem

    git remote rm origin

  12. git remote add origin git@github.com:wuzhuzhu/ts.git

  13. git push -u origin master

    Counting objects: 19, done.
    Compressing objects: 100% (16/16), done.
    Writing objects: 100% (19/19), 4.54 KiB, done.
    Total 19 (delta 1), reused 0 (delta 0)
    To git@github.com:wuzhuzhu/ts.git
    [new branch] master -> master
    Branch master set up to track remote branch master from origin.


拉取git文檔:
在遠程主機上:

  1. git remote add origin git@github.com:wuzhuzhu/ts.git
  2. git pull origin master

碰見的問題:

  • windows 客戶端是渣...仍是要用git shell 要不連建立repo都老是網絡報錯 遠程服務器要搞定ssh key... git
  • remote add origin git@github.com:wuzhuzhu/ts.git
  • 是指制定origin到這個git網址,不要重複綁定.

`

相關文章
相關標籤/搜索