ใน repo ปัจจุบันของฉันฉันมีผลลัพธ์ต่อไปนี้:
$ git branch -a
* master
remotes/origin/master
remotes/public/master
ฉันต้องการลบremotes/public/masterจากรายการสาขา:
$ git branch -d remotes/public/master
error: branch 'remotes/public/master' not found.
นอกจากนี้ผลลัพธ์ของgit remoteมันแปลกเพราะมันไม่ได้แสดงpublic:
$ git remote show
origin
ฉันจะลบ 'รีโมท / สาธารณะ / มาสเตอร์' จากรายการสาขาได้อย่างไร
อัปเดตลองgit pushคำสั่ง:
$ git push public :master
fatal: 'public' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
git remote prune [remote-name]จะไม่ทำงานกับ git svn แม้ว่าจะไม่มีgit gc... git branch -rd origin/nameทำงานได้ @ กรณีที่คุณอาจเลือกคำตอบที่สอง - มันอันตรายน้อยกว่าเล็กน้อย
master... โดยเฉพาะเมื่อทำการลบบนรีโมต
git remote prune [remote-name]หรือgit fetch -p [remote-name]ไม่ทำงานในสถานการณ์ของคุณหรือไม่ การทำเช่นgit gcนี้มีพลังมากกว่าที่จำเป็นตามปกติ