An open API service indexing awesome lists of open source software.

https://github.com/johnnelbaylen/git

Cheat Sheet
https://github.com/johnnelbaylen/git

git

Last synced: about 1 year ago
JSON representation

Cheat Sheet

Awesome Lists containing this project

README

          

# Git Commands Guide

## Repository Management

- `git init` - Initialize a new Git repository
- `git clone ` - Clone a repository from a URL

## Basic Commands

- `git status` - Show the status of changes
- `git add ` - Add changes to the staging area
- `git commit -m "message/title"` - Commit changes with a descriptive message
- `git log` - View commit history

## Branching

- `git branch` - List branches
- `git branch -M ` - Create and rename a new branch
- `git checkout ` - Switch to a specific branch
- `git merge ` - Merge changes from a branch
- `git branch -d ` - Delete a branch

## Remote Repositories

- `git remote` - List remote repositories
- `git remote add ` - Add a remote repository
- `git push ` - Push changes to a remote repository
- `git pull ` - Pull changes from a remote repository

## Undoing Changes

- `git pull` - Fetch and merge changes from the remote repository
- `git fetch` - Fetch changes without merging
- `git reset --hard HEAD` - Discard all local changes
- `git revert ` - Revert changes in a specific commit

## Notes

This guide provides a quick reference to essential Git commands for repository management, branching, remote operations, and undoing changes.