Git
A free and open-source distributed version control system (DVCS) designed for speed and efficiency. It is a command-line tool that allows developers to track changes in source code (Source Code Management - SCM) during software development, enabling collaboration, branching, merging, and reverting to previous versions of code. Git itself is a local software that runs on a developer's machine.
GitHub
GitHub is a web-based platform that provides hosting for Git repositories. It is a centralised service built around Git, offering a user-friendly interface and a wide range of features for collaboration, code sharing, and project management.
GitLab
It is a comprehensive DevSecOps platform that integrates Git hosting with a full suite of development tools (Continuous Integration/Continuous Development - CI/CD, security scanning, and project management tools), available both as a cloud service and a self-hosted solution. GitLab aims to provide a comprehensive solution for the entire software development lifecycle within a single platform
Versioning is the process of assigning unique labels or identifiers to different versions of a file, document, or software to manage changes over time.
Allowing people to track history, revert to previous states, and manage different iterations without losing work.
Working Directory: File workspace holding the current state of the project that Git has not tracked.
Staging Area/Index: Area where changes are prepared before committing them to Git/GitHub.
Local Repository: The area storing the project's history on the local PC (includes commits, branches, etc.).
Remote Repository: The project version is hosted on a remote server/cloud, allowing collaboration.
Branches: A Parallel version of the project, allowing different fixes to be worked on independently without affecting the main project until a merge is executed.
Pull Requests: A way to propose changes from one branch to another; request review, discuss, and possibly merge the changes into the target branch (used in team collaborations).
Merging: The process of integrating changes from one branch into another.
git config --list: View Git Configuration (Author, Email Address, Branch, Origin URL, etc).
git init>: Initialise Git (start tracking).
git status>: Red Files (not in the staging area) and Green Files (added to the staging area).
Add files to the staging area:
All files: git add .
Specific file: git add <filename.ext>
Commit Changes: git commit -m <commit message>
git push origin: Push (upload) changes to the remote repository, or
If using a different repo - git push <remote repository> <branch name>
Note: .gitignore - Create and use this file to list the files (names or extensions) to not commit to a remote repository.
git clone <url>: download a repository from GitHub (including all files, branches, and commits).
git status: view unstaged new or edited files.
git config -e: edit the local Git configuration file.
git diff main origin/main: Compare local main branch with main remote repository
Installing Git: https://github.com/git-guides/install-git
Git Image: https://www.pexels.com/@realtoughcandy/