Jadi saya menambahkan folder ke file .gitignore saya.
Setelah saya melakukan git status
itu memberitahu saya
# On branch latest
nothing to commit (working directory clean)
Namun, ketika saya mencoba mengubah cabang saya mendapatkan yang berikut:
My-MacBook-Pro:webapp marcamillion$ git checkout develop
error: The following untracked working tree files would be overwritten by checkout:
public/system/images/9/thumb/red-stripe.jpg
public/system/images/9/original/red-stripe.jpg
public/system/images/8/thumb/red-stripe-red.jpg
public/system/images/8/original/red-stripe-red.jpg
public/system/images/8/original/00-louis_c.k.-chewed_up-cover-2008.jpg
public/system/images/7/thumb/red-stripe-dark.jpg
public/system/images/7/original/red-stripe-dark.jpg
public/system/images/7/original/DSC07833.JPG
public/system/images/6/thumb/red-stripe-bw.jpg
public/system/images/6/original/website-logo.png
public/system/images/6/original/red-stripe-bw.jpg
public/system/images/5/thumb/Guy_Waving_Jamaican_Flag.jpg
public/system/images/5/original/logocompv-colored-squares-100px.png
public/system/images/5/original/Guy_Waving_Jamaican_Flag.jpg
public/system/images/4/thumb/DSC_0001.JPG
public/system/images/4/original/logo.png
public/system/images/4/original/DSC_0001.JPG
public/system/images/4/original/2-up.jpg
public/system/images/3/thumb/logo2.gif
public/system/images/3/original/logo2.gif
public/system/images/3/original/Guy_Waving_Jamaican_Flag.jpg
public/system/images/3/original/11002000962.jpg
public/system/images/2/thumb/Profile Pic.jpg
public/system/images/2/original/Profile Pic.jpg
public/system/images/2/original/02 Login Screen.jpg
public/system/images/1/original/Argentina-2010-World-Cup.jpg
Please move or remove them before you can switch branches.
Aborting
Seperti inilah file .gitignore saya:
.bundle
.DS_Store
db/*.sqlite3
log/*.log
tmp/**/*
public/system/images/*
public/system/avatars/*
Bagaimana cara ini berfungsi sehingga saya bisa berganti cabang tanpa menghapus file-file itu?
Jika saya melakukan perubahan, apakah itu akan memengaruhi file-file itu? Dengan kata lain, jika saya kembali ke cabang ini setelah itu akankah semuanya sempurna sesuai dengan komitmen terbaru saya?
Saya tidak ingin kehilangan file-file itu, saya hanya tidak ingin mereka dilacak.