Top Related Projects
Most commonly used git tips and tricks.
A list of cool features of Git and GitHub.
Flight rules for git
Quick Overview
The joshnh/Git-Commands repository is a concise reference guide for Git commands. It provides a curated list of commonly used Git commands along with brief explanations, making it a handy resource for developers of all skill levels who work with Git version control.
Pros
- Easy to understand and navigate
- Covers a wide range of Git commands
- Regularly updated with community contributions
- Serves as a quick reference for both beginners and experienced developers
Cons
- Lacks in-depth explanations for complex Git operations
- May not cover some advanced or less common Git commands
- No interactive examples or visualizations
- Limited to command-line Git usage, doesn't cover GUI tools
Code Examples
This repository is not a code library but a reference guide, so code examples are not applicable in the traditional sense. However, here are a few examples of Git commands from the repository:
# Clone a repository
git clone username@host:/path/to/repository
# Add one or more files to staging (index)
git add <filename>
git add *
# Commit changes to head (but not yet to the remote repository)
git commit -m "Commit message"
Getting Started
As this is a reference guide and not a code library, there's no traditional "getting started" process. Users can simply visit the GitHub repository at https://github.com/joshnh/Git-Commands to access the list of Git commands. The README.md file contains all the information, organized into sections such as "Create", "Local Changes", "Commit History", and more.
To make the most of this resource:
- Bookmark the repository for quick access.
- Use the table of contents to navigate to specific sections.
- Contribute to the project by submitting pull requests for new commands or improvements.
Competitor Comparisons
Most commonly used git tips and tricks.
Pros of tips
- More comprehensive, with over 150 tips and tricks
- Regularly updated with new Git features and commands
- Includes advanced Git techniques and workflows
Cons of tips
- Less beginner-friendly, with more complex commands
- Lacks clear categorization, making it harder to find specific information
- Some tips may be too specific for general use cases
Code comparison
Git-Commands:
git init
git clone <repo>
git add <file>
git commit -m "message"
git push origin master
tips:
git config --global alias.co checkout
git rev-list --count HEAD
git log --pretty=format:"%h - %an, %ar : %s"
git for-each-ref --count=10 --sort=-committerdate refs/heads/
git diff-tree --no-commit-id --name-only -r <commit-ish>
The Git-Commands repository focuses on basic Git operations, while tips provides more advanced and specialized commands. Git-Commands is better suited for beginners, offering a concise list of essential commands. In contrast, tips caters to experienced users seeking to optimize their Git workflow with advanced techniques and lesser-known features.
A list of cool features of Git and GitHub.
Pros of github-cheat-sheet
- More comprehensive coverage of GitHub-specific features and workflows
- Regularly updated with new GitHub features and best practices
- Includes advanced topics like GitHub Actions and GitHub Pages
Cons of github-cheat-sheet
- Less focused on basic Git commands and operations
- May be overwhelming for beginners due to its extensive content
- Requires more time to navigate and find specific information
Code Comparison
Git-Commands:
git init
git clone <repo>
git add <file>
git commit -m "message"
git push origin master
github-cheat-sheet:
git shortlog -sn
git config --global alias.<handle> <command>
git describe --tags --abbrev=0
git rev-list --count master
git log -<limit> --pretty=format:"%h - %an, %ar : %s"
The Git-Commands repository focuses on essential Git operations, while github-cheat-sheet provides more advanced and GitHub-specific commands. Git-Commands is better suited for beginners, offering a concise list of fundamental commands. In contrast, github-cheat-sheet caters to more experienced users, providing a wider range of commands and techniques for efficient GitHub usage.
Flight rules for git
Pros of git-flight-rules
- More comprehensive and detailed explanations
- Covers a wider range of Git scenarios and edge cases
- Regularly updated with new content and contributions
Cons of git-flight-rules
- Can be overwhelming for beginners due to its extensive content
- Less concise and harder to quickly find specific commands
Code Comparison
Git-Commands:
git init
git clone <repo>
git add <file>
git commit -m "message"
git push origin master
git-flight-rules:
git init
git clone <repo>
git add <file1> <file2> <file3>
git commit -m "Detailed commit message explaining changes"
git push origin <branch-name>
Summary
Git-Commands is a concise cheat sheet for common Git operations, ideal for quick reference. It's beginner-friendly but lacks depth for complex scenarios.
git-flight-rules offers a comprehensive guide to Git, covering various situations and providing detailed explanations. It's better suited for users seeking in-depth understanding and solutions to specific Git problems.
Both repositories serve different purposes: Git-Commands for quick command lookup, and git-flight-rules for troubleshooting and learning advanced Git concepts.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Git Commands
Translated Versions
- Versão em português
- Versión en español
- Türkçe versiyon
- AzÉrbaycanca versiya
- বাà¦à¦²à¦¾ সà¦à¦¸à§à¦à¦°à¦£
- हिनà¥à¤¦à¥ ठनà¥à¤µà¤¾à¤¦
- اÙعربÙØ©
A list of my commonly used Git commands
If you are interested in my Git aliases, have a look at my .bash_profile
, found here: https://github.com/joshnh/bash_profile/blob/master/.bash_profile
--
Getting & Creating Projects
Command | Description |
---|---|
git init | Initialize a local Git repository |
git clone ssh://git@github.com/[username]/[repository-name].git | Create a local copy of a remote repository |
Basic Snapshotting
Command | Description |
---|---|
git status | Check status |
git add [file-name.txt] | Add a file to the staging area |
git add -A | Add all new and changed files to the staging area |
git commit -m "[commit message]" | Commit changes |
git rm -r [file-name.txt] | Remove a file (or folder) |
git remote -v | View the remote repository of the currently working file or directory |
Branching & Merging
Command | Description |
---|---|
git branch | List branches (the asterisk denotes the current branch) |
git branch -a | List all branches (local and remote) |
git branch [branch name] | Create a new branch |
git branch -d [branch name] | Delete a branch |
git push origin --delete [branch name] | Delete a remote branch |
git checkout -b [branch name] | Create a new branch and switch to it |
git checkout -b [branch name] origin/[branch name] | Clone a remote branch and switch to it |
git branch -m [old branch name] [new branch name] | Rename a local branch |
git checkout [branch name] | Switch to a branch |
git checkout - | Switch to the branch last checked out |
git checkout -- [file-name.txt] | Discard changes to a file |
git merge [branch name] | Merge a branch into the active branch |
git merge [source branch] [target branch] | Merge a branch into a target branch |
git stash | Stash changes in a dirty working directory |
git stash clear | Remove all stashed entries |
git stash pop | Apply latest stash to working directory |
Sharing & Updating Projects
Command | Description |
---|---|
git push origin [branch name] | Push a branch to your remote repository |
git push -u origin [branch name] | Push changes to remote repository (and remember the branch) |
git push | Push changes to remote repository (remembered branch) |
git push origin --delete [branch name] | Delete a remote branch |
git pull | Update local repository to the newest commit |
git pull origin [branch name] | Pull changes from remote repository |
git remote add origin ssh://git@github.com/[username]/[repository-name].git | Add a remote repository |
git remote set-url origin ssh://git@github.com/[username]/[repository-name].git | Set a repository's origin branch to SSH |
Inspection & Comparison
Command | Description |
---|---|
git log | View changes |
git log --summary | View changes (detailed) |
git log --oneline | View changes (briefly) |
git diff [source branch] [target branch] | Preview changes before merging |
Top Related Projects
Most commonly used git tips and tricks.
A list of cool features of Git and GitHub.
Flight rules for git
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot