一、下載git-for-windowshtml
(1)經常使用的GitHub客戶端msysgit,也就是git-for-windows。git
(2)登陸官網 https://git-for-windows.github.io/,以下,單擊Download按鈕下載。github
(3)我下載了最新版64位:Git-2.11.0-64-bit.exeweb
二、安裝git-for-windowssql
(1)單擊Nextshell
(2)選擇安裝目錄windows
(3)勾選建立桌面快捷方式、Git Bash、Git GUi、已經目錄和後綴關聯等,如圖。bash
(4)默認便可,單擊Nexteclipse
(5)在「Adjusting your PATH environment」選項中,默認選項是「Use Git from the Windows Command Prompt」,這樣在Windows的命令行cmd中也能夠運行git命令了,點擊「Next」。ssh
(6)配置行結束標記,保持默認「Checkout Windows-style, commit Unix-style line endings」.
(7)在終端模擬器選擇頁面,默認便可,配置後Git Gash的終端比較易用。而後點擊「Next」按鈕
(8)最後配置Git額外選擇默認便可。
(9)安裝成功
(10)安裝Git完成以後,會在桌面建立Git Bash快捷方式,在任意目錄下右擊鼠標能夠找打Git Bash Here的選項。
三、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。
四、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)