it is: git add full path of your file with file name
suppose I want to add a file MainActivity.kt then If i do
git add MainActivity.kt it will throw error sayingfatal: pathspec 'MainActivity.kt did not match any files
so to avoid that:
git add app/src/main/java/com/androminor/firstcompose/MainActivity.kt
I checked all of the above answer. To my surprise they where half baked reply giving wrong output.