下载 git2.14.1 64bitpython
https://git-for-windows.github.io/(官网下载不动)git
http://download.csdn.net/download/tang9018/9934317 (下载快)github
https://git-scm.com/book/zh/v1 (说明文档)
windows
安装
next 下一步
设置目录
勾选须要的项:
Additional icons是关于图标的设置
In the Quick Launch是快速启动图标
On the Desktop是桌面快捷方式
Windows Explorer integration是资源管理器集成(右键菜单)
Git Bash Here是在当前目录运行Git命令行
Git GUI Here是在当前目录运行Git原生界面
ssociate .git* configuration files with the default text editor是将全部.git开头的文件使用默认文本编辑器打开
Associate .sh files to be run with Bash是将全部扩展名为.sh的文件使用Git命令行执行
Use a TrueType font in all console windows是在全部命令行(包括Windows系统cmd命令行窗口)中都使用TrueType字体
是否建立在开始菜单中? Don‘t create... 不建立。
环境设置
Use Git from Git Bash only不会修改系统环境变量,可是Windows系统cmd命令行中没法使用git命令
Use Git from the Windows Command Prompt会将git相关程序加入系统环境变量中,使得Windows系统cmd命令行中可使用git命令
Use Git and optional Unix tools from the Windows Command - Prompt会将git相关程序以及一些其余的Unix工具加入系统环境变量,使得Windows系统cmd命令行中可使用git以及Unix工具
选择库
use the openssl library 使用OpenSSL库
use the native windows secure channel library 使用本机Windows安全通道库
转行规则
Checkout Windows-style, commit Unix-style line - endings选项让Git可以自动转换文件中的换行符;签出到本地时转换为Windows下的换行符,提交到服务器时转换为Unix下的换行符
Checkout as-is, commit Unix-style line endings选项让Git在签出到本地时不作转换,保留原始文件的换行符;提交到服务器时转换为Unix下的换行符
Checkout as-is, commit as-is让Git在签出到本地时和提交到服务器时都不作转换
使用控制台程序
Use MinTTY (the default terminal of MSys2) 选项使用一款叫作MinTTY的软件做为Git命令行,MinTTY是一款模拟Unix系Bash终端的软件。优势是命令记录、可配置字体、可改变窗口大小等等,缺点是可能没法直接运行原Windows下的一些命令行程序
Use Windows‘ default console windows选项使用Windows系统cmd命令行来做为Git命令行。优势和缺点正好和上一个选项相反。
其余选项
Enable file system chaching 启用文件缓存
Enable Git Credential Manager 启用凭据管理
Enable symbolic links 启用符号连接
等待安装进度。
Launch git Bash 如今启动
View release notes 查看发行说明
等待安装完成后,在CMD命令中输入git或者git --version命令查看是否安装成功。
缓存
一、设置邮箱和地址安全
第一个要配置的是你我的的用户名称和电子邮件地址。这两条配置很重要,每次 Git 提交时都会引用这两条信息,说明是谁提交了更新,因此会随更新内容一块儿被永久归入历史记录:服务器
$ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com
若是用了 --global
选项,那么更改的配置文件就是位于你用户主目录下的那个,之后你全部的项目都会默认使用这里配置的用户信息。若是要在某个特定的项目中使用其余名字或者电邮,只要去掉 --global
选项从新配置便可,新的设定保存在当前项目的 .git/config
文件里。ssh
二、提升命令输出可读性编辑器
$ git config --global color.ui auto
三、查看配置信息工具
git config --list
1.注册GitHub
2.本地得到SSH Key
git中输入
ssh-keygen -t rsa -C "邮箱地址"
回车、输入密码、确认密码
C盘/用户名/.ssh 下会生成两个文件
id_rsa文件是私有密钥,id_rsa.pub是公有密钥
3.在github中添加公有密钥
把本地生成的密钥输入进 NEW SSH KEY
4.在github建立仓库
建立仓库成功后得到SSH
5.得到仓库数据
在本地指定路径右键
输入
git clone git@github.com:buchizaodian/python.git
成功下载到本地
6.推送到GitHub
经过Add 命令将文件加入暂存区
git add abc.txt
commit 提交( “”里是描述)
git commit -m "abc"
git log 查看日志
git log
git push 当即推送到服务器
git push