[Git]Push new git repository

Kaycheng
2 min readOct 30, 2017

--

這次push新的repository,輸入最後一步git push -u origin master後,發生錯誤,terminal出現:

error: src refspec master does not match any.
error: failed to push some refs to ‘git@github.com:XXX/ToDoList.git’

查了一下資料,才發現是自己在push過程中,忘記加上git commit -m “message”這個步驟,以後要注意!

Push github的步驟:git initgit status(查看狀態)git add .(把所有檔案夾上)git commit -m “message”(將這次夾上的資料取名)打開Github創建新的repository輸入…or push an existing repository from the command line的第一行輸入git remote -v(確認帳號正確)輸入…or push an existing repository from the command line的第二行

這樣就完成github的第一次deploy!

另外,要出現上面灰色區域的方式是:

全選要套用的區域後,按鍵盤上的option+command+6即可。

--

--

No responses yet