Uncategorized

“git refname refs heads master not found” hatası

Github’da bir depo oluştururken bu hatayla karşılaştım

$ git branch -M main
error: refname refs/heads/master not found
fatal: Branch rename failed

Bu hata, Github’ın varsayılan dalı ana daldan ana şubeye değiştirmesi nedeniyle oluşur. Boş depoyu başlatmanın doğru yolu aşağıdaki gibidir.

git remote add origin git@github.com:
git add .
git commit -m “first commit”
git branch -M main
git push -u origin main

ayrıca “git config –edit” komutu ile açılan dosya düzenlenebilir.

Leave a comment