CompTIA Linux+ (XK0-005) — Question 277

Which of the following Git commands would send committed changes to a remote repository?

Answer options

Correct answer: C

Explanation

The correct answer is C, as 'git push origin master' specifically uploads the committed changes from the local repository to the specified branch of a remote repository. Option A, 'git stash', temporarily saves changes instead of pushing them. Option B, 'git commit -a', only records changes in the local repository and does not interact with the remote. Option D, 'git add *.*', stages files for commit, but does not push any changes to a remote repository.