Explore tens of thousands of sets crafted by our community.
Common Git Commands
20
Flashcards
0/20
git init
Initializes a new Git repository
git clone [url]
Clones a repository into a new directory
git add [file]
Adds a file to the staging area
git commit -m "[message]"
Records file snapshots in the version history
git status
Displays the state of the working directory and staging area
git push [alias] [branch]
Pushes commits made on a local branch to a remote repository
git pull [alias] [branch]
Fetches changes from the remote repository and merges them into the local branch
git branch
Lists, creates, or deletes branches
git checkout [branch-name]
Switches to a specified branch and updates the working directory
git merge [branch]
Merges specified branch’s history into the current branch
git fetch [alias]
Downloads objects and refs from a remote repository
git log
Shows the commit logs
git diff
Shows the differences not yet staged
git reset
Resets the staging area to match the most recent commit, but leaves the working directory unchanged
git rm [file]
Removes files from the working directory and staging area
git stash
Temporarily stores all modified tracked files
git tag
Creates, lists, deletes or verifies a tag object signed with GPG
git show [commit]
Displays information about a git object such as a commit
git remote -v
Lists all remote repositories
git config --global user.name "[name]"
Sets the name that will be attached to your commits and tags
© Hypatia.Tech. 2024 All rights reserved.