git 本地關聯GitHub

  1. 新建目錄,然後git init
  2. 創建祕鑰
    ssh-keygen -t rsa -C "[email protected]"
  3. 去GitHub添加祕鑰
    cat ~/.ssh/id_rsa.pub
  4. 測試連接 ssh -T [email protected]
  5. 添加Git配置
    $ git config --global user.name "your name"
    $ git config --global user.email "[email protected]"
    
  6. 添加遠程地址
    git remote add origin [email protected]:yourName/yourRepo.git
  7. 提交前先pull
    git pull --allow-unrelated-histories
  8. 提交
    $ git commit -m 'my project push'
    $ git push origin master
    
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章