I am new to Git and learnt from my coworkers through the use of Git for IntelliJ IDEA. Recently I have started to read the Git official documentation, which talk about "staged files", a word that I never heard in this context. Consequently I am currently a bit confused and unsure about the meaning of what a "staged file" is.
The documentation says that a modified tracked file needs to be staged thanks to the command git add
in order to be committed, and that a file can be both staged and unstaged, meaning that only the staged part of the file can be committed, leaving the file still modified with the unstaged part after using the command "git commit".
Using Intellij IDEA, I never had to manually stage a file to correctly commit it, even though I already was able to commit only part of a file, without really knowing what was going on behind the curtains. So, can you confirm me that with Git for IntelliJ IDEA, files are implicitly staged first when we commit them ?
IntelliJ provides a unified user interface that supports a number of Version Control Systems (VCS) including SVN, Git, Mercurial and other. When you open the commit window (Ctrl + K) IntelliJ bypasses Git stage feature and allows you to add files implicitly while committing them.
In a sense this is similar to git commit -a
, as per docs:
-a
--all
Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.