前言
這是我在 fork 別人專案的時候, clone 到自己 local 電腦修改後無法上傳所碰到的情況
fatal: couldn't find remote ref master
「注意: 只是記錄我碰到的問題, 並非所有碰到此訊息都是一樣的解法」
個人解法
後來注意到 .git/config 裡面
原來 origin branch name 是 「main」 而不是常見的 「master」 (也是常見啦沒有對錯)
總之就是不能下
git push origin master
這種情況要改下
git push origin main
Reference
- https://blog.csdn.net/ltstud/article/details/79935001
- https://gitbook.tw/chapters/github/fail-to-push
- https://stackoverflow.com/questions/29297154/github-invalid-username-or-password