I made changes to two files in different directory, How can I add the two files for a single commit. can I do like, add the first, then change the directory to second file and add the second file finally do the commit. Is this going to work?
You can add all the files using
git add file1.txt folder/file2.txt file3.txt file4.txt file5.txt
And the commit your the files you wish to commit.
git commit file1.txt folder/file2.txt file3.txt -m"I committed file1.txt folder/file2.txt"
You will have added
to staging area and then commited with the same message.
Note that files are added or committed in the same format
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