git入门(msysgit图文安装)

1、下载git-for-windows

    (1)常用的GitHub客户端msysgit,也就是git-for-windows。

      (2)登录官网 https://git-for-windows.github.io/,如下,单击Download按钮下载。

      (3)我下载了最新版64位:Git-2.11.0-64-bit.exe

 2、安装git-for-windows

(1)单击Next

          

     (2)选择安装目录

        

     (3)勾选创建桌面快捷方式、Git BashGit GUi、已经目录和后缀关联等,如图。

   

  (4)默认即可,单击Next

   

  (5)Adjusting your PATH environment”选项中,默认选项是“Use Git from the Windows Command Prompt这样在Windows的命令行cmd中也可以运行git命令了点击Next”。

   

  (6)配置行结束标记,保持默认Checkout Windows-style, commit Unix-style line endings.

   

  (7)在终端模拟器选择页面,默认即可,配置后Git Gash的终端比较易用。然后点击“Next按钮

   

  (8)最后配置Git额外选择默认即可。

    

   

   (9)安装成功

   

   (10)安装Git完成之后,会在桌面创建Git Bash快捷方式,在任意目录下右击鼠标可以找打Git Bash Here的选项。

     

     

3、git配置

        (1)   本地创建SSH key

              ssh-keygen -t rsa -C "your_email@youremail.com"

             一路回车,不需要输入。

          (2) 成功的话会在~/下生成.ssh文件夹,进去,复制id_rsa.pub文件内容

     (3)添加SSH   Key

       


单击“Add SSH key”


   

   (3)为了验证是否成功,在git bash下输入:

          $ ssh -T git@github.com

    如果是第一次的会提示是否continue,输入yes就会看到:You've successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上github



4、git简单应用


Administrator@Win7 MINGW64 /d/code

$ git clone https://github.com/ihadron/jdbc.git

Cloning into 'jdbc'...

remote: Counting objects: 5, done.

remote: Compressing objects: 100% (4/4), done.

remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0

Unpacking objects: 100% (5/5), done.

Administrator@Win7 MINGW64 /d/code

$ cd jdbc

Administrator@Win7 MINGW64 /d/code/jdbc (master)

$ ls -a

./  ../  .git/  .gitignore  LICENSE  README.md


Administrator@Win7 MINGW64 /d/code/jdbc (master)

$ git add .

warning: LF will be replaced by CRLF in WebContent/index.html.

The file will have its original line endings in your working directory.

warning: LF will be replaced by CRLF in WebContent/login.html.

The file will have its original line endings in your working directory.

warning: LF will be replaced by CRLF in WebContent/login.jsp.

The file will have its original line endings in your working directory.

warning: LF will be replaced by CRLF in WebContent/password.jsp.

The file will have its original line endings in your working directory.

warning: LF will be replaced by CRLF in WebContent/regist.html.

The file will have its original line endings in your working directory.

warning: LF will be replaced by CRLF in WebContent/regist.jsp.

The file will have its original line endings in your working directory.

warning: LF will be replaced by CRLF in WebContent/update.jsp.

The file will have its original line endings in your working directory.

 

Administrator@Win7 MINGW64 /d/code/jdbc (master)

$ git commit -m "jdbc v1.0"

[master c509c83] jdbc v1.0

 19 files changed, 417 insertions(+)

 create mode 100644 .classpath

 create mode 100644 .project

 create mode 100644 .settings/.jsdtscope

 create mode 100644 .settings/org.eclipse.jdt.core.prefs

 create mode 100644 .settings/org.eclipse.wst.common.component

 create mode 100644 .settings/org.eclipse.wst.common.project.facet.core.xml

 create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.container

 create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.name

 create mode 100644 WebContent/META-INF/MANIFEST.MF

 create mode 100644 WebContent/WEB-INF/web.xml

 create mode 100644 WebContent/index.html

 create mode 100644 WebContent/login.html

 create mode 100644 WebContent/login.jsp

 create mode 100644 WebContent/password.jsp

 create mode 100644 WebContent/regist.html

 create mode 100644 WebContent/regist.jsp

 create mode 100644 WebContent/ulist.jsp

 create mode 100644 WebContent/update.jsp

 create mode 100644 mydb.sql

 

Administrator@Win7 MINGW64 /d/code/jdbc (master)

$ git push -u origin master

Username for 'https://github.com': ihadron

Counting objects: 25, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (20/20), done.

Writing objects: 100% (25/25), 6.33 KiB | 0 bytes/s, done.

Total 25 (delta 5), reused 0 (delta 0)

remote: Resolving deltas: 100% (5/5), done.

To https://github.com/ihadron/jdbc.git

   7a049ec..c509c83  master -> master

Branch master set up to track remote branch master from origin.

 

Administrator@Win7 MINGW64 /d/code/jdbc (master)

$

  • 10
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
要快速安装 Git入门使用,你可以按照以下步骤进行操作: 1. 首先,你需要下载 Git 安装程序。你可以在官方网站上找到适合你操作系统的安装程序:https://git-scm.com/downloads 2. 下载完成后,运行安装程序。 3. 在安装向导中,选择适合你操作系统的选项和默认设置。你可以按照默认设置继续安装。 4. 安装完成后,打开命令行终端(Windows 用户可以使用 Git Bash 或者 Git GUI),输入以下命令来配置你的 Git 用户名和邮箱: ``` git config --global user.name "Your Name" git config --global user.email "youremail@example.com" ``` 5. 接下来,你可以创建一个新的 Git 仓库或者克隆一个已有的仓库。 - 初始化新仓库: 在命令行终端中,进入到你要初始化 Git 仓库的目录,并执行以下命令: ``` git init ``` - 克隆已有仓库: 执行以下命令,将远程仓库克隆到本地: ``` git clone <repository_url> ``` 6. 现在你可以开始使用 Git 进行版本控制了。常用的操作包括添加文件、提交更改、查看提交历史等。以下是一些常用的 Git 命令: - `git add <file>`:将文件添加到暂存区。 - `git commit -m "commit message"`:提交更改到本地仓库。 - `git status`:查看当前仓库状态。 - `git log`:查看提交历史。 - `git push`:将本地提交推送到远程仓库。 这些是入门 Git 的基本步骤和命令。你可以通过阅读 Git 的官方文档或者其他教程来深入了解 Git 的更多功能和用法。祝你使用 Git 愉快!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值