Here is a folder, which contains a lot of .java files.
How can I git commit this folder ?
If I do the following commands
git add foldername git commit foldername -m "commit operation"
I will see the messages nothing added to commit but untracked fils present (use "git add" to track)
The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area. We also say that they will be staged.
So, to recursively add all files or folders and also sub folders to the staging area of git, we can either call “git add -A” or “git add –all”, it will add all files in the project workspace to the staging area, irrespective of location from where this command is executing.
You don't "commit the folder" - you add the folder, as you have done, and then simply commit all changes. The command should be:
git add foldername git commit -m "commit operation"
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