Git学习笔记
2016-04-05 20:17
465 查看
小白一枚。学习笔记。仅供参考。欢迎指错。
一、快速开发
git –version #查看git版本信息
mkdir tom #创建目录
cd tom #进入目录
git init #创建版本库
ls -a #查看所有文件
echo “zxq” >> zxq #创建文件zxq
git add zxq # 将zxq加入版本控制器
git status # 查看信息
git commit -m “first commit” #提交更改
export GIT_EDITOR=vim #设置默认编辑器
git status # 查看信息
配置作者的信息
git config user.name “zxq”
git config user.email “zxq@sina.com”
查看提交日记
git log
git show ad8031e #查看对象ID对应的信息
git show-branch –more=10
git diff 对象ID1 对象ID2 #查看区别
vim zxq #修改内容
git add zxq
git commit -m “add akuma”
git log
git diff 089238 ad8031e
git rm zxq
git status
git commit -m “rm zxq”
================我是拦路虎==========================
git mv zxq akuma #改名
git commit -m “change to akuma”
mv akuma zxq
git rm akuma
git add zxq
git commit -m “change to zxq” #提交内容
cd ..
git clone tom jerry #克隆版本库
ls -als tom jerry #查看区别
diff -r tom jerry #查看区别
配置文件
.git/config
~/.gitconfig #只有使用 - -global 选项后才会出现
git config user.name “zxq”
git config -l #显示所有的配置信息
git config –unset user.name #取消配置信息
一、快速开发
git –version #查看git版本信息
mkdir tom #创建目录
cd tom #进入目录
git init #创建版本库
ls -a #查看所有文件
echo “zxq” >> zxq #创建文件zxq
git add zxq # 将zxq加入版本控制器
git status # 查看信息
git commit -m “first commit” #提交更改
export GIT_EDITOR=vim #设置默认编辑器
git status # 查看信息
配置作者的信息
git config user.name “zxq”
git config user.email “zxq@sina.com”
查看提交日记
git log
git show ad8031e #查看对象ID对应的信息
git show-branch –more=10
git diff 对象ID1 对象ID2 #查看区别
vim zxq #修改内容
git add zxq
git commit -m “add akuma”
git log
git diff 089238 ad8031e
git rm zxq
git status
git commit -m “rm zxq”
================我是拦路虎==========================
git mv zxq akuma #改名
git commit -m “change to akuma”
mv akuma zxq
git rm akuma
git add zxq
git commit -m “change to zxq” #提交内容
cd ..
git clone tom jerry #克隆版本库
ls -als tom jerry #查看区别
diff -r tom jerry #查看区别
配置文件
.git/config
~/.gitconfig #只有使用 - -global 选项后才会出现
git config user.name “zxq”
git config -l #显示所有的配置信息
git config –unset user.name #取消配置信息
相关文章推荐
- 如何向数据库插入带有单引号(')的字符串?
- HTTP常见状态码
- ReactNative 代码调试方法
- OpenGL基础图形编程(二)OpenGL概念建立
- LintCode_97_二叉树的最大深度
- 数据库连接jndi
- 页面置换算法
- faster-rcnn数据替换
- 1027. Colors in Mars (20)
- GreenHandX1h 2016.4.5 (3) (✵节表✵)
- 笔试携程经验
- 方柱类
- Android Activity的滑动销毁
- 《剑指Offer》学习笔记——重建二叉树
- CSS滑动门特性
- ios: Designated Initializer
- android-学习资源
- JDK、myeclipse和tomcat都什么版本可用servlet 3.0
- ZOJ 3872-Beauty of Array(递推||DP)
- Android 5.0以后:Service Intent must be explitict