Help page for git commands
Command to setup username for git commit
git config --global user.name "<username>"
Command to setup email for git commit
git config --global user.email "<email>"
Command to add a remote git repository URL to local git repository
git remote add <name to identify the remote> <remote git repository url>
Command to cleanup untracked or temproary files from a git repository
Command to check the commit list
Command to amend the last commit message
git commit --amend -m "New commit message"
Command to revert the last unpushed commit
Command to display the current configurations of a git repository
Recommended CRLF setting in .gitconfig for a git repository
core.autocrlf = true for Windows
core.autocrlf = input for Linux
Use the below command to set this:
git config --global core.autocrlf = <value>
Command to check difference of a file from current to another branch
git diff <another-branch> -- <file-path>