Git Overview for Beginners
Git Overview for Beginners
What is Git?
Git is a distributed version control system (VCS) that helps track changes in source code
during software development. It allows multiple developers to collaborate efficiently,
maintain versions of files, and revert to previous versions if needed.
Stages of Git
Mayank Singh
1. Working Directory:
o git commit -m "message" saves the staged changes into the local repository
with a snapshot.
Example Workflow:
Default Branch
When a repository is created, the default branch is usually main (formerly master in older
Git versions). It points to the latest commit in the local repository.
Mayank Singh
A central repository is a remote repository (hosted on platforms like GitHub or GitLab) used
for collaboration. It serves as a common location for developers to pull and push changes.
Pull: Fetches updates from the remote repository to the local repository.
Push: Sends local commits to the remote repository.
Example:
Snapshot in Git
Git saves changes as snapshots of the entire project at a specific point in time. Each commit
is a snapshot of the files in the staging area.
Metadata in Git
Metadata is information about the repository, such as commit history, branch details, and
configuration stored in the .git directory.
Branches in Git
Workflow:
1. Create a branch:
4. Delete a branch: