Category Archive GIT

Byphunsanit

Git: จัดระเบียบกิตให้เป็นกิจวัตร

บางครั้งโปรเจคสั้น ๆ ที่ทำไม่นานแต่จะมีเอกสาร มีการวางรูปแบบไฟล์ไว้ต่างกัน อย่างตอนที่เขียน WordPress: Gutenberg Block Development งานที่ทำอยู่ใน plugin เท่านั้น แต่อยากเก็บไฟล์ให้เหมือนงานอื่น ๆ จะได้ดูง่าย

  1. สร้าง directory หรือ git clone ลงมาในเครื่องของเราก่อน เช่น /Users/Shared/Gits/phunsanit/WP-a-link
  2. สร้าง folder ไว้แยกไฟล์ต่าง ๆ เป็นระบบ เช่น Documents, SourceCode
  3. ย้าย directory ที่เก็บเฉพาะที่จะแก้ข้อมูลไปไว้ใน git driectory เช่น /Users/Shared/Gits/phunsanit/WP-a-link/SourceCode
  4. สร้าง symbolic link ไว้จะได้ใช้ GIT ง่าย ๆ
    ln -s { path to the file/folder to be linked } { the path of the link to be created }
    เช่น
    ln -s /Users/Shared/Gits/phunsanit/WP-a-link/SourceCode /opt/homebrew/var/www/WordPress/wp-content/plugins/rm-a-link
  5. ทดสอบดูว่า code ยังทำงานปกติ

อ่านเพิ่มเติม