Using Git Bash for Windows

Source: Internet
Author: User
Tags using git

This article experiences the use of Git bash on the Windows operating system.

What is bash?

is a shell environment, Bourne Again shell abbreviation.

install git for Windows

→http://git-for-windows.github.io/
→download, choose a suitable version
→ Installation
→ After installation there are git Bash, git CMD, and git GUI this three application
→ Run git Bash to check the current version
git version
→ Exit
Exit

Installing notepad++

→notepad-plus-plus.org
→download, choose the right version
→ Installation

Open notepad++ in bash

→ Find the notepad++ application file
In C:\Program files (x86) \notepad++, the C:\Program files (x86) \notepad++ are generally assigned
→ Right Click "My Computer", click "Advanced System Settings", click "Environment variable", double-click Path, put; C:\Program Files (x86) \notepad++ add to the end, click "OK"
→ Run git Bash
→notepad++
This will open the notepadd++ in bash.

Show view current directory

→ Run git Bash
→ View current directory
Pwd
Display/c/users/darren, where/c/is equivalent to C \,
→ List all files under the current folder
Ls
Or
Ls-l

Replace current directory

→ Run git Bash
→ Navigate to a different directory
CD videos/
→ Back to upper level
Cd..
→ Navigate to My Documents directory
CD my\ documents/
→ Return to Level Three
Cd.. /.. /.. /
→ Back to home directory
CD ~
→ Navigate to a directory on an absolute location
cd/c/windows/system32/

View command Source

→ View the source of the LS command
Whick ls
Show/bin/ls

Show Print

→ Show print environment variables
Echo $PATH

View File Contents

→ View a file content
Cat Test.txt
→ View a file content and edit
Less test.txt


Create, rename, move, delete files

→ Create an empty file
Touch Demo.txt
→ Rename a file
MV Demo.txt Demo-1.txt
→ Delete known files
RM demo-1.txt

Create, delete directory

→ Create a directory
mkdir projects
→ Delete Directory
RMDIR projects
→ create multi-level catalogs
mkdir projects/client-a/awesome-web-project/
→ Delete multi-level catalogs
RM-RF projects/

emptying and exiting

→ Clear contents
Clear
→ Exit the console
Exit

console Print information output to file

→ Print information output append to create file
echo "HI" >> demo.txt
→ print information input rewrite known file
echo "Hello" > Demo.txt

Execute bash Script

→ See where bash is installed
Which bash
Display:/bin/bash
→ Create an open file with notepad++
notepad++ example.sh
→ input Command

#!/bin/bash

echo "Hi, everyone"




























Using Git Bash for Windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.