how to git commit a whole folder?

后端 未结 6 813
囚心锁ツ
囚心锁ツ 2021-01-30 20:33

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 c         


        
6条回答
  •  离开以前
    2021-01-30 21:00

    To Add a little to the above answers:

    If you are wanting to commit a folder like the above

    git add foldername
    git commit -m "commit operation"
    

    To add the folder you will need to be on the same level as, or above, the folder you are trying to add.

    For example: App/Storage/Emails/email.php

    If you are trying to add the "Storage" file but you have been working inside it on the email.php document you will not be able to add the "Storage" file unless you have 'changed directory' (cd ../) back up to the same level, or higher, as the Storage file itself

提交回复
热议问题