Loading tool…
cheatsheet
git initInitialize a new Git repository
git clone <repository_url>Clone a repository from a URL
git add .Add all new and modified files to the staging area
git add <filename>Add a specific file to the staging area
git commit -m 'Initial commit'Commit staged changes with a message
git statusShow the status of changes as untracked, modified, or staged
git logShow commit history
git branchList local branches
git branch <new_branch_name>Create a new branch
git checkout <branch_name>Switch to a different branch
git checkout -b <new_branch_name>Create and switch to a new branch
git merge <branch_to_merge>Merge a branch into the current branch
git branch -d <branch_name>Delete a local branch
git remote -vList remote repositories
git push origin <branch_name>Push changes to a remote repository
git pull origin <branch_name>Fetch and merge changes from a remote repository
git fetchDownload objects and refs from another repository
git remote add origin <repository_url>Add a new remote repository
git reset HEAD <filename>Unstage a file from the staging area
git checkout -- <filename>Discard changes in working directory
git revert <commit_hash>Create a new commit that undoes changes from a previous commit
git reset --hard HEAD~1Discard last commit (use with caution, loses history)
git config --global user.name 'Your Name'Set global user name
git config --global user.email '[email protected]'Set global user email
git config --listList all Git configurations
Get new cheatsheets & tools in your inbox
No spam — just new releases, occasionally.