https://github.com/johnnelbaylen/git
Cheat Sheet
https://github.com/johnnelbaylen/git
git
Last synced: about 1 year ago
JSON representation
Cheat Sheet
- Host: GitHub
- URL: https://github.com/johnnelbaylen/git
- Owner: JohnnelBaylen
- Created: 2025-03-23T14:06:25.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-25T00:06:34.000Z (over 1 year ago)
- Last Synced: 2025-03-25T01:21:59.375Z (over 1 year ago)
- Topics: git
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.