สามารถคอมมิตกับ github [ซ้ำกัน]

Aug 18 2020

ฉันเตรียมโปรเจ็กต์และอยากจะผูกมัดกับ Github นอกจากนี้ยังมีเดสก์ท็อป Git + GitHub และใช้ VSCode และเทอร์มินัลในนั้น ดังนั้นเมื่อฉันพยายามตรวจสอบ 'git' จากเทอร์มินัลใน VSCode ในโฟลเดอร์ที่มีโครงการฉันมีปัญหา:

git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ git
+ ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

เมื่อใช้ cmd ทั่วไปทุกอย่างก็โอเค! ฉันจะแก้ไขได้อย่างไร?

คำตอบ

albeksdurf Aug 18 2020 at 10:18

เนื่องจากไม่ได้ตั้งค่าไดเรกทอรีgitปฏิบัติการ ( git.exe) ของคุณในPATHตัวแปรดังนั้น PowerShell จึงไม่สามารถค้นหาได้

คุณต้องค้นหาโฟลเดอร์ที่ติดตั้ง git และเพิ่มเข้าไปPATHโดยใช้ตัวแก้ไขตัวแปรสภาพแวดล้อมของ Windows

ดูคำแนะนำโดยละเอียดในคำตอบนี้