What's the use of the staging area in Git?

前端 未结 5 960
青春惊慌失措
青春惊慌失措 2021-02-01 14:54

What is the point of git add . or git add to add it to the staging area? Why not just git commit -m \"blabla\"?

5条回答
  •  一向
    一向 (楼主)
    2021-02-01 15:33

    If you think staging is a useless then you may be aware of full power of git and software development too.Staging means that you want to commit those files to your current branch. Sometimes it happens that you may not want to commit some files so those files will not be staged for commit.

    For example :- some default configuration that are specific to your system so you may not want to commit those config files to the branch where in everyone is using those. I hope it clears your doubt! :-)

提交回复
热议问题