Github command cheatsheet
git init: Initialize a new Git repository.git clone <repository-url>: Clone a repository onto your local machine.git add <file>: Add file changes to the staging area.git commit -m "message": Commit staged changes to the repository.git push <remote> <branch>: Push committed changes to a remote repository.git pull <remote> <branch>: Fetch changes from a remote repository and merge them into the current branch.git branch: List, create, or delete branches.git checkout <branch>: Switch between branches or restore working tree files.git merge <branch>: Merge changes from one branch into another.git status: Show the current status of the repository.git log: Display commit history.git remote: Manage remote repositories.git fetch <remote>: Download objects and refs from another repository.git stash: Temporarily shelve changes.git revert <commit>: Revert commits.git config: Configure Git settings.git tag: Create, list, delete, or verify tags.git reset: Reset current HEAD to the specified state.git rm <file>: Remove files from the working tree and the index.git mv <old-path> <new-path>: Move or rename a file, directory, or symlink.git show: Show various types of objects.git blame: Show what revision and author last modified each line of a file.git diff: Show changes between commits, commit and working tree, etc.git fetch: Download objects and refs from another repository.git rebase: Reapply commits on top of another base tip.git cherry-pick <commit>: Apply the changes introduced by some existing commits.git bisect: Find by binary search the change that introduced a bug.git grep <pattern>: Print lines matching a pattern.git archive: Create an archive of files from a named tree.git submodule: Initialize, update or inspect submodules.git clean: Remove untracked files from the working tree.git reflog: Manage reflog information.git difftool: Show changes using common diff tools.git mergetool: Run merge conflict resolution tools to resolve conflicts.git fetch --prune: Remove any remote-tracking references that no longer exist on the remote.git remote show <remote>: Show information about a given remote.git shortlog: Summarize 'git log' output.git describe: Show the most recent tag that is reachable from a commit.git revert --no-commit: Revert changes, but don't create a new commit.git push --force: Forcefully push commits to a remote repository.
Last updated