Git 零基础入门--Git Bash

Git 工具分类

  • 命令行
    • Bash、Cmd、Power Shell,等
  • GUI
    • Git GUI、Github Desktop,等
  • IDE集成
    • Visual Studio、 Eclipse、IntelliJ IDE, 等

设置Git Bash 环境

在Git Bash窗口上边框右键,选择Options菜单进行设置
  • 光标颜色Cursor
    默认:白色,改成:绿色
  • 光标形状
    默认:下划线Line,改成:块状Block
  • 光标闪烁Blinking
    默认:闪烁,改成:不闪 去掉勾选Blinking
  • 字体大小TEXT
    默认:9号,改成:14号
  • Git Bash支持中文输入
    打开路径Options->Text设置
    Locale:zh_CN
    Character set:UTF-8

常用 Bash 命令

  • #change directory
    cd
  • #make directory
    mkdir
  • #print working directory
    pwd
  • #move
    mv
  • #copy
    cp
  • #remove
    rm

设置 Git 参数

  • #显示当前的Git配置
    git config --list
  • #设置提交仓库时的用户名信息
    git config --global user.name “mike”
  • #设置提交仓库时的邮箱信息
    git config --global user.email "[email protected]"

创建本地仓库 create a new repository on the command line (eg.远程仓库TestGit)

  • echo " # demo" >> README.md
  • git init
  • git add README.md
  • git commit -m “first commit”
  • git remote add origin https://github.com/**/TestGit
  • git push -u origin master

提交本地仓库到Github远程仓库

  • git remote add origin https://github.com/**/TestGit
  • git push -u origin master

你可能感兴趣的:(Git)