Tools
การลบ .DS_Store files ใน Git repository
ถ้าหากใครใช้ Git บน macOS อาจจะมีปัญหาเวลา commit Project ขึ้น Git ไปแล้ว แต่ลืม ignore .DS_Store file ซึ่งในบทความนี้ก็จะแนะนำวิธีการแก้ไขง่ายๆ เพียงไม่กี่บรรทัด
02 พฤษภาคม 2021 • 1 นาที
0

Table of Contents
Find .DS_Store
หาไฟล์ .DS_Store
และทำการลบมันทิ้งซะ

find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
add .DS_Store
เพิ่ม .DS_Store
เข้าไปในไฟล์ .gitignore

echo .DS_Store >> .gitignore
Commit
ขั้นตอนสุดท้าย Commit เข้า Repo ก็เป็นอันเสร็จเรียบร้อย

git add .gitignore
git commit -m '.DS_Store banished!'
git push origin (branch)
Source
Tags:Git
คลิกเพื่อแสดงความคิดเห็น