51 cards
Git is a distributed version control system designed to track changes in source code throughout the software development lifecycle. Unlike older centralized systems, every developer working with Git holds a complete copy of the repository, including its full history. Git stores data as snapshots of the project at speci...
Starting a new project or joining an existing one both rely on a small set of foundational Git commands. The command git init initializes a brand-new repository in the current directory by creating the hidden .git folder that holds all version-control data. To obtain a copy of an existing remote repository, developers...
Branches are Git's mechanism for parallel development, allowing multiple lines of work to coexist without interfering. The command git branch <branch-name> creates a new branch that points to the current commit, while git checkout -b <branch-name> both creates a branch and immediately switches to it. To mov...
A remote repository is a version of a Git project hosted on a server such as GitHub, GitLab, or Bitbucket, enabling developers to share work across teams. Before interacting with one, the local repository must be linked to it using git remote add <name> <url>, where origin is the conventional name for the p...
Mistakes are inevitable in software development, and Git provides several commands to correct them safely. The most powerful and dangerous is git reset <commit>, which moves the branch pointer to a previous commit. Depending on the flags used, reset behaves differently: --soft keeps changes staged, --mixed (the d...
Tags are Git's mechanism for marking specific commits as significant, typically for software releases. An annotated tag, created with git tag -a <name> <commit>, stores metadata such as a tagger name, date, and message, and behaves like a full Git object. A lightweight tag, created with git tag <name>...
Git offers a variety of tools for personalizing workflows and keeping repositories tidy. Git aliases, configured via git config --global alias.<shortcut> <command>, allow frequently used commands to be shortened; for example, git config --global alias.st status makes git st equivalent to running git status....