Repaso
Español
Maven, Git & SDLCFoundationsVCS-30

Which sequence is the everyday Git flow to save and share a change?

Options

  1. git add → git commit → git push (Correct option)
  2. git push → git add → git commit
  3. git commit → git clone → git add
  4. git pull → git delete

Answer

git add → git commit → git push

Why

  • git clone <url>: copy a remote repo to your machine (once).
  • git add <file>: choose changes for the next snapshot (staging).
  • git commit -m "message": save the snapshot locally.
  • git push: send your commits to the remote repository.
  • git pull: bring the others' commits to your machine.

Before starting work, pull; when done, add, commit and push.

Remember

add → commit → push.

Key terms

Practice this question in Repaso