เพราะว่าเป็น project ที่ทำเกี่ยวกับการ import / export excel file แล้วมันจะมีไฟล์ temporary ที่ถูกสร้างขึ้นมาในเวลาเปิดไฟล์นั้นใน folder ที่อยู่ใน git ที่นี่เวลา push ไฟล์ที่แก้ขึ้น มันก็ชอบไปโผล่ใน tracked list ที่จะเอาขึ้น รึเปล่า บ่อย ๆ ก็ใส่ใน .gitignore ไว้ดีกว่า ไม่เสียเวลา
ทำได้โดยเปิดไฟล์ .gitignore แล้วเพิ่มบรรทัดพวกนี้เพิ่ม
.~lock.# [._]
.tmp ~$
*.tmp
~$*
| Pattern | Description |
~$* | Standard Office temporary/owner files |
.~lock.*# | LibreOffice/OpenOffice lock files |
*.tmp | General temporary files |
[._]* | macOS hidden/indexing files (like .DS_Store) |
ครั้งแรกอาจจะใช้คำสั่ง
git rm --cached ~$*
git add .gitignore
git commit -m "Ignore and remove Office temporary files"
อ่านเพิ่มเติม