Git Commands

less than 1 minute read

In this post we will look the very basic commands needed for Git based version control.

Clone repository

git clone cloning_address

Display the status

git status

Optional adding user name and email

git config username
git config useremail

Add all files to the repository

git add *

Add and remove the files accordingly

git add -A

Commit changes with a custom message

git commit -m "commit message"

Push changes to the repository

git push

pull repository to the current directory

git pull

Check configured username and email

git config
git config

List config

List local config

git config --list

List global config

git config --list --global

Add ssh key

git config --local core.sshCommand "/usr/bin/ssh -i /home/me/.ssh/id_rsa_foo"

Tags: ,