Stash uncommitted changes to the feature-update branch temporarily. ee the Solution below. Solution: git stash Explanation: Stashing saves the current working directory state, enabling temporary storage and later retrieval.
Apply the stashed changes back to the feature-update branch.ee the Solution below. Solution: git stash apply Explanation: Applying a stash retrieves the saved changes, allowing them to be continued from the stored state.
Rename the branch feature-update to feature-enhancement. ee the Solution below. Solution: git branch -m feature-update feature-enhancement Explanation: The git branch -m command renames a branch without altering its history or content.
Delete the local branch feature-enhancement after merging it into main. ee the Solution below. Solution: git branch -d feature-enhancement Explanation: Deleting a branch cleans up unused branches after their changes are merged or become unnecessary.
Fetch the latest updates from the remote repository without merging them. ee the Solution below. Solution: git fetch originExplanation: Fetching updates the local metadata with remote changes without altering the working directory or branches.
You are given access to a Git repository with the URL https://github.com/example/repo.git. Clone the repository to your local machine in the directory /home/user/projects. ee the Solution below. Solution: cd /home/user/projects git clone https://github.com/example/repo.git Explanation: Cloning a repository retrieves all files, branches, and history to your local system. The git clone command initiates this process by downloading the specified repository.