GIT Commands
Top Git Commands
git config
Usage: git config –global user.name “[name]”
Usage: git config –global user.email “[email address]”
git init
Usage: git init [repository name]
This command is used to start a new repository.
git clone
Usage: git clone [url]
This command is used to obtain a repository from an existing URL.
git add
Usage: git add [file]
This command adds a file to the staging area.
Git Add Command
Usage: git add *
This command adds one or more to the staging area.
git commit
Usage: git commit -m “[ Type in the commit message]”
This command records or snapshots the file permanently in the version history.
git show
Usage: git show [commit]
This command shows the metadata and content changes of the specified commit.
git branch
Usage: git branch
This command lists all the local branches in the current repository.
git checkout
Usage: git checkout [branch name]
This command is used to switch from one branch to another.
git merge
Usage: git merge [branch name]
This command merges the specified branch’s history into the current branch.
git remote
Usage: git remote add [variable name] [Remote Server Link]
This command is used to connect your local repository to the remote server.
git push
Usage: git push [variable name] master
This command sends the committed changes of master branch to your remote repository.
git pull
Usage: git pull [Repository Link]
This command fetches and merges changes on the remote server to your working directory.