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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *