![]() |
VOOZH | about |
The working tree in Git includes all project files outside the .git folder and represents the current state of your project where changes are made and tracked.
Remote repositories (like Github) do not have a working tree. However, in a local repository, we can analyze the working tree using:
git statusThis command helps us understand the current state of files in the working directory.
Create an empty directory and Initialize Git:
git initThe .git folder is created (not part of the working tree)
👁 ImageCreate a file named demo.txt and then run:
git status👁 ImageStage the file:
git add demo.txtCheck status again:
git status👁 ImageCommit Changes:
git commit -m "Created demo.txt"Check status again:
git status👁 ImageEdit demo.txt and run:
git status👁 Imagegit add demo.txt👁 Image
git commit -m "Update demo.txt"
Delete demo.txt and run:
git status👁 Imagegit add demo.txt👁 Image
git commit -m "Deleted demo.txt"