A developer wants to temporarily save changes without committing them to maintain a clean project history. What Git feature should they use?
- git stash
- git branch
- git commit --amend
- git tag
The correct option is a. git stash. This command allows the developer to save changes without committing them and revert the working directory to the last commit. It's useful for switching to a different branch or applying changes later. git branch is used to create, list, or delete branches. git commit --amend is used to modify the last commit, and git tag is used to create tags.
Loading...
Related Quiz
- What is the purpose of the git bisect command in debugging?
- In Git, how would you manage multiple remote repositories for the same local repository?
- Which operation in Git temporarily stores changes that you don't want to commit immediately?
- Changing the history of public branches is generally discouraged because it can lead to ________ for other collaborators.
- In terms of secure Git practices, what is the significance of signed commits?