Published: December 23, 2025
Git - Version control system
Repository - A folder where git tracks project and history
Clone(Verb!) - Make a copy of a remote repo
Stage (Verb!)- Tell git of changes to be saved next
Commit(Verb!)- Save a snapshot of staged changes
Tracked file - A file that git is watching for changes
sudo pacman -Syu git
Set username git config --global user.name "name"
Set email git config --global user.email "email"
Set default branch git config --global init.defaultBranch main (Set to main)
The configurations can also be local or system
- git config --local - Applies to the local repo
git config --system - Applies to all users and in all repos git init
git status - Check which files are tracked( or not tracked?)git add <file> - Stage a filegit add -A / git add --all - Stage all changesgit restore --staged <file> - Unstage a filegit commit -m "Message" - Commit staged changes with a messagegit commit -a -m "Message" - Commit all tracked changes skipping staging. (Does not work for new/untracked files)git log - See commit historygit commit - Opens the configured editor for the comment.git commit --amend -m "Corrected message" - Correct a git commit message.git commit --amend - (After git add) - If forgotten to add a file before commit.git reset --soft HEAD~1 - Undo last commit and keep changes staged.Git tag - A label or bookmark for a specific commit.
git tag <tagname> - Create a lightweight tag.git tag -a <tagname> - Create annotated tag.git tag - List tagsgit show <tagname> - Show tag detailsgit tag <tagname> <commit-hash> - Tag a specific commitAnnotated tag - Stores author, date and message
Lightweight tag - A simple name for a commit
git push --tags - Push all tags
git tag -d <tagname> - Delete a tag locally
git push origin --delete tag <tagname> - Delete remote tag
Save uncommitted changes and return to a clean working directory. Changes can be restored later.
Used for :
1. Moving the cursor
2. Deleting characters, words, lines etc
3. Performing …
Bash (Bourne-Again SHell) - Used to write scripts and run commands in unix based systems.
Shell - Text based …