Sorry im not understanding in your title you mention "shared commit" which is, the way ive always considered multiple users updating the same branch, but you mention that youre working on two files and you only want to commit in one of them.
Can you add a little clarity to your post?
What do you mean commiti g updates on one file out of two?
What do you mean by "file" in this instance?
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta