Git 与 Magit 初始篇
Contents
系列目的
介绍Git的基础配置及基础使用
介绍Magit的使用, 因为Magti相比与Git方便很多, 配合Emacs效率更高
使用命令行
windows 中使用bash, linux或Mac下使用terminal, 总之要开使用Git, 就要用命令行
要做的第一件事是检查电脑上是否安装了Git, 使用命令: git –version查看, 安装了则会返回版本号
没安装就去官网安装下
配置Git的名字和邮箱
让Git知道你是谁, 两条命令:
git config --global user.name "your_name"
git config --global user.email "your_email"
git config --list: #列出配置信息
git config --unset --global user.name # 取消名称设置
不使用 global 参数,则设置的是本仓库的信息
配置Git代理
# 设置当前代理
git config http.proxy http://127.0.0.1:2334
# 取消当前代理
git config --unset http.proxy
#设置socks5代理
git config http.proxy socks5://127.0.0.1
#取消全局代理
git config --global --unset http.proxy
初始化Git仓库
在需要使用Git管理的仓库中运行 git init 即可
Magit
这是Emacs下的一个Git工具, 直接在Emacs下安装该包即可, 一般现有的Emacs工具都被作者安装好了.
Emacsh下Magit的打开方式: M-x magit-status
Git趣味学习
这个游戏可以学习基础;
这个网站可以助你熟练掌握命令;
文若可采,幸赐清茗一盏,以助笔耕不辍