Cheatography
https://cheatography.com
Git is an open-source, version control tool created in 2005 by developers working on the Linux operating system; GitHub is a company founded in 2008 that makes tools which integrate with git. You do not need GitHub to use git, but you cannot use GitHub without using git.
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Git Commands:
Repository Setup
git init: Initialize a new Git repository.
git clone <repository_url>: Clone an existing Git repository.
Committing Changes
git add <file_name>: Add a file to the staging area.
git commit -m "<commit_message>": Commit changes to the repository with a message.
git status: View the status of the repository and staged files. |
|
Git Commands:
Branching and Merging
git branch: List all branches in the repository.
git branch <branch_name>: Create a new branch.
git checkout <branch_name>: Switch to a different branch.
git merge <branch_name>: Merge a branch into the current branch. |
|
Git Commands:
Repository Management
git remote add <remote_name> <remote_url>: Add a new remote repository.
git push <remote_name> <branch_name>: Push changes to a remote repository.
git pull <remote_name> <branch_name>: Pull changes from a remote repository.
git log: View commit history.
git diff: View changes between commits. |
|
Git Hub Commands:
Repository Management
git remote add <remote_name> <remote_url>: Add a new remote repository.
git push <remote_name> <branch_name>: Push changes to a remote repository.
git pull <remote_name> <branch_name>: Pull changes from a remote repository.
git clone <repository_url>: Clone an existing repository.
git fork: Create a fork of a repository. |
|
Git Hub Commands:
Pull Requests
git pull-request: Create a pull request.
git merge: Merge a pull request.
Issues
git issue: Create a new issue.
git comment: Comment on an issue or pull request.
git assign: Assign an issue to a user. |
|