Last month, I read up on the . I actually found it difficult to understand initially, but after reading several articles on Git, watching of YouTube videos, and completing my lesson on , I think I have a clear idea now. Here is a summary of the git commands I learned, as a cheat sheet for future use by me - and any other fellow Git-beginners out there. But before we dive into all that, let's address this obvious question; Git version control system a lot The Odin Project What Exactly is Git? Git is a free and open-source distributed version control system. Version control systems (also known as revision control, source control, or source code management) are used to manage changes to computer programs, documents, large websites, and other collections of information. These systems provide an automatic way to track changes in projects thereby giving creators the power to view previous versions of files and directories, securely back up the project and its history, and collaborate easily and conveniently with others. They are crucial for tracking edits made by others, correcting errors, and protecting against spam and vandalism. Distributed version control (also known as distributed revision control) is a form of version control in which the complete codebase, including its full history, is mirrored on every developer's computer. Git is accessed via a called which lets users transform an ordinary directory into a (a sort of enhanced directory with the additional ability to track changes to every file and sub-directory). Here are some basic commands frequently used when running Git ๐ command-line program git repository Git Cheatsheet All Git commands consist of the command-line program followed by the name of the command, so for the full command ... git to check the version of git installed on your system, type ๐ . git --version to set your global configuration settings (i.e. your git name and username), type ๐ and . To configure your local default git branch name to (rather than which has always been used), type ๐ . To check all your git configuration values, type ๐ . git config --global user.name <yourname> git config --global user.email <email address> main master git config --global init.defaultBranch main git config --list to initialize a git repository, type ๐ . This creates a special hidden directory called .git where git stores the information it needs to track your projectโs changes. (Itโs the presence of a properly configured directory that distinguishes a git repository from a regular directory.) git init .git to clone a remote repository on your computer, type ๐ . To create a file in a git repository just use like you would when creating a new file on the command line. To check if you've successfully connected your remote repository to your local machine, navigate to the cloned repository and confirm its URL by typing ๐ . To change the URL of your git remote origin, type ๐ git clone <URL where the repository is> touch git remote -v git remote set-url origin <newurl> to hide files in your repository that you don't want others to see, create a git ignore file using touch, type ๐ and manually include the names of those files (or file patterns/extensions) you want ignored to the .gitignore text file. touch .gitignore to check the status of your repository, use ๐ . This enables you to see all to files within the respository, displayed to show; files that are merely in your working directory (these are termed 'untracked files'), files that have been edited but not yet (re)staged for commit and files in the staging area (with about to be committed to the repository). git status changes changes to make a commit in git: first add the file (or files) you want to commit to the staging area, type ๐ to add a single file or to add all unstaged files and to add all untracked files and directories . Then type ๐ to commit your changes. git add <filename> git add . in the current directory git add -A in the repository git commit -m <a message describing what you have done to make this snapshot different> to remove a single file from the staging area, type ๐ or or . To remove all files, simply type ๐ . To check the difference between the last commit and unstaged changes in your current project, type ๐ . git reset <filename> git restore --staged <filename> git rm --cached <filename> git reset git diff to upload/push your work to a remote repository, type ๐ . To see the history of your commits, type ๐ . This command shows only the commits messages which isn't particularyly detailed. To see the full diffs representated by each commit, use the flag, type ๐ git push origin main git log -p git commit -p to commit in your currently existing files, pass the flag to the command by typing ๐ . The flag commits to files in the repository. Always remember to type ๐ when there are new files. all changes -a git commit git commit -am <message> -a all pending changes git add -A to see the difference between staged changes and the previous version of the repo, type ๐ . git diff --staged to correct an error in /update your last commit message, type ๐ . To ascertain that your git commit message was properly updated, run to get the SHA of your last commit then view the diff using ๐ . git commit --amend git log git show <SHA> Additional Resources . Learn Enough Git to be Dangerous Corey Schafer's on Youtube. Git Tutorial for Beginners Fireship's Youtube video on Git It? How to use Git and Github ๐ ๐ Hey, thanks for reading!