0

I want to commit a number of files that have changed. Yet, there is one file, which should be excluded only for this commit. Thus, I looking for something like

git commit -m "Many changes." * -ignore src/later.txt

1

2 Answers 2

5

Just do git add . then git reset the file you don't want

git add .
git reset src/later.txt
git commit -m "Many changes"
Sign up to request clarification or add additional context in comments.

2 Comments

Wouldn't git add -u would be better here?
I don't know if the file the OP is talking about is tracked or not, actually... at least my hunch from reading is that it's a tracked file. But anyway, without knowing if it is tracked or not, we can't really be sure if -u would pull it off or not.
0

to do this you should unstage that particular file using "git reset --pathoffile" then go ahead commit others

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.