how to git commit a whole folder?

后端 未结 6 819
囚心锁ツ
囚心锁ツ 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 20:59

    When you “add” something in Git, you add it to the staging area. When you commit, you then commit what’s in the staging area, meaning it’s possible to commit only a sub-set of changed files at any one time.

    In your case, you want to add the folder to the staging area, and then just do a normal commit:

    $ git add foldername
    $ git commit -m 'Helpful commit message'
    

提交回复
热议问题