Sobes.tech
Junior — Middle

Can you tell me about the most frequently used Git commands for version control?

sobes.tech AI

Answer from AI

Basic Git commands commonly used for version control:

  • git init — initialize a new repository.
  • git clone <url> — clone a remote repository.
  • git status — shows the current state of the repository, modified files.
  • git add <file> — add changes to the staging area.
  • git commit -m "message" — save changes to the local repository.
  • git push — push commits to the remote repository.
  • git pull — fetch and merge changes from the remote repository.
  • git branch — show list of branches.
  • git checkout <branch> — switch between branches.
  • git merge <branch> — merge the specified branch into the current one.
  • git log — view commit history.

These commands cover basic operations for version control and collaborative coding.