1. Git Basics

Estimated reading: 1 minute 20 views

Git is a version control system that helps track changes in source code during software development. The basic commands for using Git include:

  • git init: Initializes a new repository in a project directory.
  • git clone <repository>: Creates a local copy of a remote repository to work with.
  • git status: Displays the current state of the working directory and staging area, showing what files are modified or untracked.
  • git add <file>: Stages changes made to a file, preparing it to be committed.
  • git commit -m "<message>": Records the changes in the repository with a message describing the update.
  • git log: Views the commit history, showing previous changes made to the repository.
  • git reset <file>: Unstages changes made to a file, but keeps the modifications in the working directory.
  • git checkout <file>: Discards changes made to a file, restoring it to the last committed version.

These commands are essential for managing project versions and collaborating effectively in a team setting.

To learn more about these Git commands, click on the article name below:

Leave a Comment

Share this Doc

1. Git Basics

Or copy link

CONTENTS