ฉันสร้าง repo ส่วนตัว แต่ไม่สามารถผลักดันจากเทอร์มินัล [ซ้ำ]

Aug 19 2020

ฉันสร้างโปรเจ็กต์ในเทอร์มินัล Ubuntu แล้วฉันก็ทำ

git init
git add .
git commit -m "fc"

จากนั้นฉันสร้าง repo ส่วนตัวบน github

สุดท้าย

~$ git remote add github.com/my-user-name/XXXXXXX.git ~$ git push -u origin master

แต่ฉันได้รับข้อผิดพลาดนี้

fatal: 'github.com/my-user-name/XXXXXXX.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ฉันตั้งค่า SSH กับคอมพิวเตอร์เครื่องนี้แล้ว

ขอบคุณสำหรับความช่วยเหลือ

คำตอบ

1 wjandrea Aug 19 2020 at 10:14

คุณต้องระบุโปรโตคอลเหมือนหรือhttps:// git://หากไม่มีโปรโตคอล URL จะอ้างถึงไฟล์บนคอมพิวเตอร์ของคุณซึ่งอาจไม่มีอยู่จริง

ตัวอย่างเช่น

git remote add origin https://github.com/my-user-name/XXXXXXX.git