Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to git commit a whole folder?

Tags:

git

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)

like image 768
Miyazaki Avatar asked Aug 15 '13 07:08

Miyazaki


People also ask

How do I add an entire folder in git?

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.

How do I make a folder recursive in git?

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.


1 Answers

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" 
like image 75
devrobf Avatar answered Sep 21 '22 00:09

devrobf