git乱码解决:在Ubuntu下,git status时,中文文件名乱码类似“274\232\350\256\256\346\200\273\347\273\223.png”,修改配置即可"git config --global core.quotepath false"

(参考:http://blog.zengrong.net/post/1249.html)

配置全局.gitigonre
添加文件~/.gitignore_global,然后在~/.gitconfig里加入:

[core]
excludesfile = ~/.gitignore_global
.
# 忽略所有后缀为.a的文件
*.a
# 不忽略lib.a(相对于上面的)
!lib.a
# 只忽略根下的TODO,不递归到子目录
/TODO
# 忽略所有build/下的文件
build/
# 忽略类似doc/notes.txt,但不包括doc/aa/bb.txt
doc/*.txt
# 忽略所有doc文件夹下的txt文件,递归到子目录
doc/**/*.txt . Short Status
$ git status -s
M README
MM Rakefile
A lib/git.rb
M lib/simplegit.rb
?? LICENSE.txt New files that aren’t tracked have a ?? next to them, new files that have
been added to the staging area have an A, modified files have an M and so on. .
git diff 与已经commit的比较
git diff --staged 已经add的比较与已经commit的比较
git diff --cached 与staged同义 .
git rm .txt 会真的删除文件2.txt(需要commit)
git rm --cache .txt 只是移除git的管理状态,不会删除物理文件
git rm log/\*.log 删除log文件夹中的.log文件,注意这里的\*中的\是对*进行转义
git rm \*~ .
git mv a.txt b.txt
=
mv a.txt b.txt
git rm a.txt
git add b.txt
(这种3行命令的方式,git依然能够理解是在进行重命名操作) .
git log 查看log
git log -p 查看每次提交的变化
git log -p - 查看最近两次提交的变化
git log --stat 查看提交的统计信息(如下:)
README | ++++++
Rakefile | +++++++++++++++++++++++
lib/simplegit.rb | +++++++++++++++++++++++++
files changed, insertions(+)
git log --pretty=oneline
git log --pretty=format:"%h - %an, %ar : %s"
Option Description of Output
%H Commit hash
%h Abbreviated commit hash
%T Tree hash
%t Abbreviated tree hash
%P Parent hashes
%p Abbreviated parent hashes
%an Author name
%ae Author e-mail
%ad Author date (format respects the –date= option)
%ar Author date, relative
%cn Committer name
%ce Committer email
%cd Committer date
%cr Committer date, relative
%s Subject
git log --pretty=format:"%h %s" --graph //a nice little ASCII graph
git log --since=.weeks . Undong Things
git commit --amend //场景:刚已经进行了提交,但是可能有文件忘记了add
或者还有什么需要修改后在这次提交中提交的,可以使用--amend,这样可以将这些修改补充到刚才的提交中
git add .txt
git commit -m 'hahh, a commit'
#oh no, a file named .txt is forgetten. but it should be committed in this commit
git add .txt
git commit --amend
#hahah, 'amend' is useful. git reset HEAD test.txt 撤销add
git checkout -- test.txt 撤销修改(慎用!会使修改丢失) .
git clone https://github.com/schacon/ticgit
git remote
git remote -v
git remote add pb https://github.com/paulboone/ticgit
git fetch pb
git remote show origin (see much more information)
git remote rename pb paul 重命名 .
Git uses two main types of tags: lightweight and annotated.
A lightweight tag is very much like a branch that doesn’t change – it’s just a pointer to a specific commit.
Annotated tags, however, 【are stored as full objects in the Git database】. They’re checksummed; contain the tagger name, e-mail, and date; have a tagging message; and can be signed and verified with GNU Privacy Guard (GPG). It’s generally recommended that you create annotated tags so you can have all this information; but if you want a temporary tag or for some reason don’t want to keep the other information, lightweight tags are available too. git tag
git tag -l 'v1.8.5*' git tag -a v1. -m 'my version 1.4' 添加Annotated tag
git show v1. git tag v1.4.1-lw 添加Lightweight Tags
git show v1.4.1-lw git tag -a v1. 9ab3ef34 根据某次提交记录打tag git push origin v1. 推送tag(git默认是不会推送tag的)
git push origin --tags 推送所有tag git checkout -b version2 v2.0.0 根据标记创建分支 . 给git命令设置别名
git config --global alias.unstage 'reset HEAD --'
git unstage fileA
等效于:
git reset HEAD fileA git config --global alias.last 'log -1 HEAD'
use: git last

参考:

1. git pro

git命令笔记2的更多相关文章

  1. git命令笔记

    git -bare init git remote add origin ssh://myserver.com/home/git/myapp.git git remote show origin [r ...

  2. git 命令笔记

    切换 git 远程仓库HEAD分支 $ git remote set-head origin some_branch

  3. Git初探--笔记整理和Git命令详解

    几个重要的概念 首先先明确几个概念: WorkPlace : 工作区 Index: 暂存区 Repository: 本地仓库/版本库 Remote: 远程仓库 当在Remote(如Github)上面c ...

  4. Git项目协同开发学习笔记1:项目库开发基础git命令

    这年头git基本都是项目开发的标配,之前刚好碰到了就花了两天时间系统学习了下.本文内容基本来自以下tutorial:Learn Git(建议直接去看原文,因为这个网站是有更新的).这个是我看过对git ...

  5. 项目管理---git----快速使用git笔记(六)------本地开发与远程仓库的交互----常用git命令

    无论是我们自己把本地的项目新建了一个远程仓库 还是 从远程仓库获取到了 本地,现在我们都在本地有了一份项目代码,服务器上对应有项目代码的信息. 现在我们就开始进行交互操作了. 也就是说明一些在 正常开 ...

  6. Git学习笔记整理【图像解析、基础命令、分支、远程仓库】

    Git别名设置:https://www.cnblogs.com/hero123/p/9105381.html Git远程项目公钥配置:https://www.cnblogs.com/hero123/p ...

  7. [git] 基础命令笔记

    --内容整理自廖雪峰的GIT教程-- git status 查看当前工作区状态,显示未跟踪的文件以及未上传的修改记录 git init 使当前文件夹变成Git可以管理的仓库 git add xxx 将 ...

  8. Git学习笔记01--常用Git命令、cmd命令及Git总结性知识

    资源:外国网友制作的 Git Cheat Sheet 第二次学习廖雪峰老师的Git教程,学习过程中把教程中涉及到的Git命令及总结性知识记录下来方便二次复习. 知识点 所有的版本控制系统,其实只能跟踪 ...

  9. 我所记录的git命令(非常实用)

    一.前言 记录一下工作中常用到的git命令,只是简单的笔记,欢迎大家交流... [ 顺便问下园友们,怎么感觉博客园发布的博客搜索有时都搜不到,后台编辑能填的都填写了,还是觉得搜索排名不高? 相同的标题 ...

随机推荐

  1. TinyFrame升级之六:全局日志的设计及实现

    日志记录显然是框架设计中不可或缺的元素,在本框架中,我们将使用log4net作为日志记录的主体.下面来具体说明如何让框架继承log4net,并通过Autofac进行IOC注入. 首先,定义好我们的Lo ...

  2. 如何重现难以重现的bug

    生活中有这么一种现象:如果你关注某些东西,它就会经常出现在你眼前,例如一个不出名的歌手的名字,一种动物的卡通形象,某个非常专业的术语,等等等等.这种现象也叫做“孕妇效应”.还有类似的一种效应叫做“视网 ...

  3. Theano2.1.12-基础知识之使用GPU

    来自:http://deeplearning.net/software/theano/tutorial/using_gpu.html using the GPU 想要看GPU的介绍性的讨论和对密集并行 ...

  4. .Net Core 自定义序列化格式

    序列化对大家来说应该都不陌生,特别是现在大量使用WEBAPI,JSON满天飞,序列化操作应该经常出现在我们的代码上. 而我们最常用的序列化工具应该就是Newtonsoft.Json,当然你用其它工具类 ...

  5. byte[] 转字符串 中文乱码

    闲来无事,写了一个UWP的UDP/TCP小Demo,网上找了个网络调试助手,就兴冲冲的开始玩耍 结果“鸡同鸭讲”: 讲英文的时候大家都是abc,hello man!how are you? 讲中文的时 ...

  6. unity3d 三分钟实现简单的赛车漂移

    提到赛车游戏,大家最关心的应该就是漂移吧?! 从学unity开始,我就一直在断断续续的研究赛车 因为自己技术太烂.悟性太差等原因,我走了不少弯路 也许你会说,网上那么多资料,你不会查啊 是啊!网上一搜 ...

  7. HIbernate的基本包——八个,详细条目

    antlr-2.7.6commons-collections-3.1dom4j-1.6.1hibernate3javassist-3.9.0.GAjta-1.1slf4j-api-1.5.8slf4j ...

  8. 通过android 客户端上传图片到服务器

    昨天,(在我的上一篇博客中)写了通过浏览器上传图片到服务器(php),今天将这个功能付诸实践.(还完善了服务端的代码) 不试不知道,原来通过android 向服务端发送图片还真是挺麻烦的一件事. 上传 ...

  9. Java网络编程——TCP/UDP

    UDP:面向无连接 ☆ 将数据及源地址和目的地址封装成数据包中 ☆ 每个数据报的大小限制在64K ☆ 不可靠协议 ☆ 不需要建立连接,速度快 TCP:面向有连接 ☆ 建立连接,形成传输数据的通道 ☆ ...

  10. jQ1.5源码注释以及解读RE

    jQ作为javascript的库( ▼-▼ ), 尽善尽美, 代码优美,  值得学习.  这一周平常上班没啥事也看jQ1.5的代码, 今天周六差不多看完了(Sizzle部分还没看), 重新看了一下, ...