Git has three main areas on your machine. Which list is correct?
Options
- Working directory, staging area, local repository (Correct option)
- Server, client, cache, and the remote repository
- Branch, tag, commit, and the local configuration
- Backup, restore, delete, and the history logs
Answer
Working directory, staging area (index), local repository
Why
- Working directory: the files you see and edit.
- Staging area (index): a waiting room where you choose what goes into the next commit (
git add). - Local repository: the permanent history of commits (
git commit).
Then git push sends your commits to a remote repository (GitHub).
Flow: edit, git add, git commit, git push.
git add src/App.java
git commit -m "Add user validation"
git push origin feature/validationRemember
Edit, add (stage), commit, push.