Debug School

Mohit Dubey
Mohit Dubey

Posted on

List of Git Commands

git init: To initialize a local repository to be tracked by GIT
git clone: to clone the remote repository to local
git pull: to pull the changes remote repository to local(working dir)
** git clean** : Delete a file from git initialized repo
git add: to move the file to the staging area.
git commit: to commit the code to the local repository
git push: to push the code to the remote repository
git stash: to stash the local changes in a temporary folder
git stash pop: to pop the stashed changes
git merge: to merge the changes between two local repos
git fetch: git fetch is a primary command used to download contents from a remote repository
git pull: Git fetch + Git Merge
git cherrypick: to merge the particular change from feature to master branch or any branch
git rm: remove the change or unstage it from local repo
git tag: to tag the latest commit in a local branch
git tag -d : delete the tag
git mv : to move the file or changes between two folders in local repo
git diff : to check the difference between two commits, two commit id need to be passed as arguments
git log: to check the history of commit for a specific branch
git revert: to revert the latest changes or commits from local branch
git status: to check the status of the particular change or file
git config : To set the configuration for your git repo like username , Email

Top comments (0)