Dev Toolbox
Crypto
Token generator
Hash text
Bcrypt
UUIDs generator
ULID generator
Encrypt / decrypt text
BIP39 passphrase generator
Hmac generator
RSA key pair generator
Password strength analyser
PDF signature checker
Converter
Date-time converter
Integer base converter
Roman numeral converter
Base64 string encoder/decoder
Base64 file converter
Color converter
Case converter
Text to NATO alphabet
Text to ASCII binary
Text to Unicode
YAML to JSON converter
YAML to TOML
JSON to YAML converter
JSON to TOML
List converter
TOML to JSON
TOML to YAML
Web
Encode/decode URL-formatted strings
Escape HTML entities
URL parser
Device information
Basic auth generator
Open graph meta generator
OTP code generator
MIME types
JWT parser
Keycode info
Slugify string
HTML WYSIWYG editor
User-agent parser
HTTP status codes
JSON diff
Outlook Safelink decoder
Images & Videos
QR Code generator
WiFi QR Code generator
SVG placeholder generator
Camera recorder
Development
Git cheatsheet
Random port generator
Crontab generator
JSON prettify and format
JSON minify
JSON to CSV
SQL prettify and format
Chmod calculator
Docker run to Docker compose converter
XML formatter
YAML prettify and format
Network
IPv4 subnet calculator
IPv4 address converter
IPv4 range expander
MAC address lookup
MAC address generator
IPv6 ULA generator
Math
Math evaluator
ETA calculator
Percentage calculator
Measurement
Chronometer
Temperature converter
Benchmark builder
Text
Lorem ipsum generator
Text statistics
Emoji picker
String obfuscator
Numeronym generator
ASCII Art Text Generator
Data
Phone parser and formatter
IBAN validator and parser

Git Cheatsheet: Your Quick Guide to Git Commands

Git is a decentralized version management software. With this cheatsheet, you will have quick access to the most common git commands.

Configuration

Set the global config

git config --global user.name "[name]"
git config --global user.email "[email]"

Get started

Create a git repository

git init

Clone an existing git repository

git clone [url]

Commit

Commit all tracked changes

git commit -am "[commit message]"

Add new modifications to the last commit

git commit --amend --no-edit

I’ve made a mistake

Change last commit message

git commit --amend

Undo most recent commit and keep changes

git reset HEAD~1

Undo the N most recent commit and keep changes

git reset HEAD~N

Undo most recent commit and get rid of changes

git reset HEAD~1 --hard

Reset branch to remote state

git fetch origin
git reset --hard origin/[branch-name]

Miscellaneous

Renaming the local master branch to main

git branch -m master main

1. Introduction to Git

1.1 What is Git?

Git is a decentralized version management software. Think of it as a time machine for your code. It allows you to travel back in time to see what your code looked like in the past, and if necessary, revert back to that point.

1.2 Importance of Git

Git is crucial in the world of software development. It allows for collaboration, keeping track of changes, and maintaining the integrity of a project. It’s like a safety net for developers, allowing them to experiment without the fear of losing or overwriting their work.

2. Git Basics

2.1 Git Terminology

Before diving into commands, let’s get familiar with some git terminology:

  • Repository: This is your project folder. It contains all your project files along with the history of changes.
  • Commit: This is a snapshot of your work at a point in time. It’s like a checkpoint in a video game, you can always go back to it if needed.
  • Branch: This is a separate version of your project. It allows you to work on different features without affecting the main project.

2.2 Basic Git Commands

Here are some of the most common git commands:

  • git init: Initializes a new Git repository
  • git add: Adds a file to the staging area
  • git commit: Saves your changes to the local repository

3. In-depth Git Commands

3.1 Git Push

git push is like sending your local changes to the remote repository. Imagine it as sending a letter. Your local changes are the letter content, and git push is the act of mailing it.

3.2 Git Pull

git pull is the opposite of git push. It fetches changes from the remote repository and merges them into your local repository. It’s like receiving a letter in the mail and adding its contents to your personal record.

3.3 Git Commit

git commit is like saving a game. It creates a snapshot of your changes, which you can revisit anytime.

3.4 Git Amend

git commit --amend lets you modify the last commit. It’s like having a conversation and realizing you misspoke, so you quickly correct yourself.

3.5 Git Rebase

git rebase is a way to integrate changes from one branch into another. It’s like weaving two threads together to create a stronger, unified piece.

3.6 Git Merge

git merge is used to combine changes from different branches. It’s like merging lanes on a highway.

3.7 Git Reset

git reset is used to undo changes. It comes in three flavors: soft, mixed, and hard. It’s like having an undo button in a word processor.

4. Conclusion

4.1 Recap

We’ve covered a lot of ground in this Git cheatsheet, from basic concepts and terminology to more advanced commands.

4.2 Importance of Cheatsheets

Cheatsheets like this one are invaluable tools for developers. They provide quick access to information, saving time and increasing productivity.