I am trying to add all the files to my git index using
git add -A
However, there is one directory with very large files that is causing this error:
fatal: confused by unstable object source data for 9f8c02a8d2a04d7fffed08b299a0cb8996ab7ecb
Therefore, the adding process is broken! How can I tell git I want to exclude this directory while adding everything else? Available online solutions first add everything and then remove some files. Obviously, I cannot do this because git crashes while adding the files in that specific directory.
Set “–assume-unchanged” to a path to exclude to check on git commit and it will exclude your file from git commit. You will need to use the git update-index and –assume-unchanged to exclude files from git commit.
You can add all the files using the git add command like below for all the files you want to add, which will add all your files to the staging area, which means the files are ready to be committed. Now commit your files, the editions or addition made in the files will now be saved.
If your Git version is new enough,
git add -- . ':!<path>'
.
means all under the current directory, and ':!<path>'
means to exclude the path. So it means to add all except path
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With