关于git的学习笔记
2014-12-11 10:55
190 查看
例如,我修改了文件 test.txt
git add test.txt
git commit test.txt
如果是git add test.txt
1.可以用git reset HEAD test.txt 将暂存区的修改撤销掉,重新放回工作区。
2.然后再用 git checkout -- test.txt 丢弃工作区的修改。
记得可以用git status 查看当前git下的状态。
Git鼓励大量使用分支:
查看分支:
创建分支:
切换分支:
创建+切换分支:
合并某分支到当前分支:
删除分支:
果然有省略的命令写法:
就可以用 git st 了~~~
还有一种设置方式:
可以让你的git界面五颜六色
git add test.txt
git commit test.txt
如果是git add test.txt
1.可以用git reset HEAD test.txt 将暂存区的修改撤销掉,重新放回工作区。
2.然后再用 git checkout -- test.txt 丢弃工作区的修改。
记得可以用git status 查看当前git下的状态。
Git鼓励大量使用分支:
查看分支:
git branch
创建分支:
git branch <name>
切换分支:
git checkout <name>
创建+切换分支:
git checkout -b <name>
合并某分支到当前分支:
git merge <name>
删除分支:
git branch -d <name>
果然有省略的命令写法:
git config --global alias.st status
就可以用 git st 了~~~
还有一种设置方式:
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
可以让你的git界面五颜六色
相关文章推荐
- git教程(关于git的学习笔记选取自廖雪峰)
- GIT学习笔记——1.1 起步 - 关于版本控制
- 【Git学习笔记】1.1 - 关于版本控制
- 关于git的命令行使用,新手学习笔记(新手入门级)
- 关于git笔记学习
- GitHub入门与实践学习笔记--github学习基础之关于git的基本操作
- 学习Git之笔记一---关于Git版本下载和环境搭建和配置
- 【Git学习笔记】1.1 - 关于版本控制
- 关于ccna的一些学习笔记
- 计算机学习笔记2:关于微程序的一点己见
- java学习笔记,关于java的一些基础知识,适用于初学者,第一节
- Spring学习笔记:关于Interceptor
- 关于SQL的学习笔记
- 学习笔记 关于refactorying
- 关于C++标准库泛型算法merge的学习笔记
- 关于朴素贝叶斯分类的学习笔记
- 关于c++的学习情况,不再更新了,因为找到了更好的笔记记录工具
- 关于用jsp实现http认证安全登陆的学习笔记。(正在原创ing)
- 孙鑫VC学习笔记:第十三讲 关于释放内存
- 关于C++标准库泛型算法reverse的学习笔记