generated from cotes2020/chirpy-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9da72ba
commit fec288f
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: Git Commands - Cheat Sheet | ||
description: Helpful Git commands to reference as a cheat sheet | ||
date: 2024-06-24 12:25:00 -0500 | ||
categories: [Cheat Sheets, Git] | ||
tags: [git, cheat sheet, commands] # TAG names should always be lowercase | ||
--- | ||
|
||
## Repository Management | ||
|
||
| Command | Description | | ||
| --- | --- | | ||
| `git init` | Initialize a new Git repository | | ||
| `git clone <url>` | Clone a remote repository | | ||
| `git status` | Show the working tree status | | ||
| `git add <file>` | Add a file to the staging area | | ||
| `git commit -m <message>` | Commit changes to the repository | | ||
| `git push` | Push changes to the remote repository | | ||
| `git pull` | Pull changes from the remote repository | | ||
| `git fetch` | Fetch changes from the remote repository | | ||
| `git merge <branch>` | Merge a branch into the current branch | | ||
| `git branch` | List all branches | | ||
| `git branch <branch>` | Create a new branch | | ||
| `git checkout <branch>` | Switch to a branch | | ||
| `git checkout -b <branch>` | Create and switch to a new branch | | ||
| `git branch -d <branch>` | Delete a branch | | ||
| `git log` | Show commit logs | | ||
| `git diff` | Show changes between commits | | ||
| `git blame <file>` | Show who changed each line in a file | | ||
| `git reflog` | Show a log of changes to HEAD | | ||
| `git reset --hard <commit>` | Reset the repository to a commit | | ||
| `git revert <commit>` | Revert a commit | | ||
| `git stash` | Stash changes in the working directory | | ||
| `git stash pop` | Apply stashed changes to the working directory | | ||
| `git tag <tag>` | Create a tag for a commit | | ||
|
||
## Configuration | ||
|
||
| Command | Description | | ||
| --- | --- | | ||
| `git config --global user.name <user>` | Set the user name for Git | | ||
| `git config --global user.email <email>` | Set the user email for Git | | ||
| `git config --global core.editor <editor>` | Set the default text editor for Git | | ||
| `git config --global color.ui auto` | Enable colored output for Git | | ||
|
||
## Remote Repositories | ||
|
||
| Command | Description | | ||
| --- | --- | | ||
| `git remote add <repository> <url>` | Add a remote repository | | ||
| `git remote -v` | List remote repositories | | ||
| `git remote show <repository>` | Show information about a remote repository | | ||
| `git remote rename <repository> <new_repository>` | Rename a remote repository | | ||
| `git remote remove <repository>` | Remove a remote repository | | ||
|
||
|