Quick Cheat sheets
git
commands are not working in CMD—or PowerShell)Git Bash is a command-line interface for Windows that provides users with a Unix-like shell experience. It allows users to execute Git commands and also provides a number of Unix commands commonly used in Linux and Mac OS X environments. Git Bash can be used as an alternative to the Windows Command Prompt or PowerShell when working with Git repositories or performing other tasks that require a Unix-style shell.
Git Bash is a command-line interface that allows you to interact with the Git version control system on Windows. Below is a list of commonly used Git Bash commands along with brief explanations of what each command does:
git init
:
Explanation: Initializes a new Git repository in the current directory, creating a new .git
directory that will store the version history and configuration.git clone [repository_url]
:
Explanation: Creates a copy of a remote Git repository on your local machine. The [repository_url]
should be the URL of the remote repository you want to clone.git add [file(s)]
:
Explanation: Adds the specified file(s) to the staging area, preparing them for the next commit. You can use wildcards (e.g., git add .
to add all files).git commit -m "commit message"
:
Explanation: Records the changes in the staging area to the repository's history, creating a new commit. The commit message describes the changes made.git status
:
Explanation: Shows the current status of the repository, including the files that are modified, staged, or untracked.git log
:
Explanation: Displays the commit history, showing the list of commits with their messages and commit details.