Add all files to a commit except a single file?

346    Asked by ArjunArora in Devops , Asked on Jul 1, 2021
I have a bunch of files in a changeset, but I want to specifically ignore a single modified file. Looks like this afte r git status:
# modified:   main/dontcheckmein.txt
# deleted:    main/plzcheckmein.c
# deleted:    main/plzcheckmein2.c

Is there a way I can do git add but just ignore the one text file I don't want to touch? Something like:

git add -u -except main/dontcheckmein.txt

You can do git add all except and also you can ignore the file by using the following commands

    git add -u
    git reset -- main/dontcheckmein.txt

Here main/dontchekmein.txt is the file that you have mentioned in the question.



Your Answer

Interviews

Parent Categories