The top 20 Git commands that you should know
By Tom Hastjarjanto and Editors
git init
: Initialize a new Git repositorygit clone
: Clone an existing repositorygit add
: Add files to the staging areagit commit
: Create a commit with the staged changesgit push
: Push commits to a remote repositorygit pull
: Pull the latest changes from a remote repositorygit branch
: Create, list, or delete branchesgit checkout
: Switch to a different branchgit merge
: Merge one branch into anothergit stash
: Stash changes that have not been staged or committedgit reset
: Undo commits or move the branch pointer to a previous commitgit rebase
: Rebase a branch onto another branch or commitgit tag
: Add a tag to a commitgit fetch
: Fetch changes from a remote repository without merging themgit diff
: Show differences between commits, branches, or filesgit show
: Show details of a commit, including the changes it containsgit log
: View the commit history of a repositorygit grep
: Search the contents of a repository for a specific string or patterngit bisect
: Perform a binary search through the commit history to find a buggit cherry-pick
: Apply the changes from a specific commit to the current branch
Tom Hastjarjanto has been using React.js since 2015. Connect with him at Twitter or LinkedIn.