数码营电子:基于微型控制器的编程、电路设计与电子产品制做。邮箱:shumaying@hotmail.com

Git Bash

From 数码营电子实验室
Jump to navigation Jump to search

What is Git Bash?

  • At its core, Git is a set of command line utility programs that are designed to execute on a Unix style command-line environment. Modern operating systems like Linux and macOS both include built-in Unix command line terminals. This makes Linux and macOS complementary operating systems when working with Git.
  • Bash is an acronym for Bourne Again Shell. A shell is a terminal application used to interface with an operating system through written commands. Bash is a popular default shell on Linux and macOS.
  • Microsoft Windows instead uses Windows command prompt, a non-Unix terminal environment. In Windows environments, Git is often packaged as part of higher level GUI applications. GUIs for Git may attempt to abstract and hide the underlying version control system primitives. This can be a great aid for Git beginners to rapidly contribute to a project. Once a project's collaboration requirements grow with other team members, it is critical to be aware of how the actual raw Git methods work. This is when it can be beneficial to drop a GUI version for the command line tools.
  • Git Bash is an application for Microsoft Windows environments which provides an emulation layer for a Git command line experience. Git Bash is a package that installs Bash, some common bash utilities, and Git on a Windows operating system, and is offered to provide a terminal Git experience.

How to use Git Bash

  • The Bash command pwd is used to print the 'present working directory'. pwd is equivalent to executing cd on a DOS(Windows console host) terminal. This is the folder or path that the current Bash session resides in.
  • The Bash command ls is used to 'list' contents of the current working directory. ls is equivalent to DIR on a Windows console host terminal.
  • Both Bash and Windows console host have a cd command. cd is an acronym for 'Change Directory'. cd is invoked with an appended directory name. Executing cd will change the terminal sessions current working directory to the passed directory argument.
  • Git Bash is packaged with additional commands that can be found in the /usr/bin directory of the Git Bash emulation. Git Bash includes the full set of Git core commands. Git Bash can actually provide a fairly robust shell experience on Windows.
Qrcode for gh a3b9e9962ce8 1280.jpg