Git bash commands

git status : show status of current directorygit init : initialise Git repositorygit config –global user.name “username“ : set the username for Git repositorygit config –global user.email “emailaddress“ : set the e-mail address for the usergit add<filename>: add the file to Git repositorygit commit -m “message“ : commit the Git action with messagegit log : show the log of Git actionsgit log -1 : show the last committed actiongit show<4 characters of the Git commit id> : show the log of the commit id and its contents differences made by the usergit diff : show the differences between local and Git repositorygit checkout –<filename> : restore the file from Git repository into local storagesed ‘s/<originaltext>/<newtext>/g’ -i <filename> : replace the text in filegit revert <4 characters of the Git commit id> : revert the commit to the previous stategit reset –hard <4 characters of the Git commit id> : reset the Git repository to its previous state, keep the commit actions before the Git commit id

vim .gitignore : open vim to write list of files to ignoregit checkout –. : close all unstaged changes