所以我在我的. gitignore文件中添加了一个文件夹。
一旦我做了git status
它告诉我
# On branch latestnothing to commit (working directory clean)
但是,当我尝试更改分支时,我得到以下内容:
My-MacBook-Pro:webapp marcamillion$ git checkout developerror: The following untracked working tree files would be overwritten by checkout:public/system/images/9/thumb/red-stripe.jpgpublic/system/images/9/original/red-stripe.jpgpublic/system/images/8/thumb/red-stripe-red.jpgpublic/system/images/8/original/red-stripe-red.jpgpublic/system/images/8/original/00-louis_c.k.-chewed_up-cover-2008.jpgpublic/system/images/7/thumb/red-stripe-dark.jpgpublic/system/images/7/original/red-stripe-dark.jpgpublic/system/images/7/original/DSC07833.JPGpublic/system/images/6/thumb/red-stripe-bw.jpgpublic/system/images/6/original/website-logo.pngpublic/system/images/6/original/red-stripe-bw.jpgpublic/system/images/5/thumb/Guy_Waving_Jamaican_Flag.jpgpublic/system/images/5/original/logocompv-colored-squares-100px.pngpublic/system/images/5/original/Guy_Waving_Jamaican_Flag.jpgpublic/system/images/4/thumb/DSC_0001.JPGpublic/system/images/4/original/logo.pngpublic/system/images/4/original/DSC_0001.JPGpublic/system/images/4/original/2-up.jpgpublic/system/images/3/thumb/logo2.gifpublic/system/images/3/original/logo2.gifpublic/system/images/3/original/Guy_Waving_Jamaican_Flag.jpgpublic/system/images/3/original/11002000962.jpgpublic/system/images/2/thumb/Profile Pic.jpgpublic/system/images/2/original/Profile Pic.jpgpublic/system/images/2/original/02 Login Screen.jpgpublic/system/images/1/original/Argentina-2010-World-Cup.jpgPlease move or remove them before you can switch branches.Aborting
这是我的. gitignore文件的样子:
.bundle.DS_Storedb/*.sqlite3log/*.logtmp/**/*public/system/images/*public/system/avatars/*
如何让这个工作,这样我就可以在不删除这些文件的情况下切换分支?
如果我做了更改,它会影响这些文件吗?换句话说,如果我之后回到这个分支,在我最近的提交之前,一切都会完美吗?
我不想失去这些文件,我只是不想让他们被跟踪。