一个”blob对象”就是一块二进制数据,它没有指向任何东西或有任何其它属性,甚至连文件名都没有. 因为blob对象内容全部都是数据,如两个文件在一个目录树(或是一个版本仓库)中有同样的数据内容,那么它们将会共享同一个blob对象。Blob对象和其所对应的文件所在路径、文件名是否改被更改都完全没有关系。
git tree 对象
July 23rd, 2011
moonfox git tree 对象 一个tree对象可以指向(reference): 一个包含文件内容的blob对象, 也可以是其它包含某个子目录内容的其它tree对象.
git commit 对象
July 23rd, 2011
moonfox Commit对象 注:合并的提交(merge commits)可能会有不只一个父对象. 如果一个提交没有父对象, 那么我们就叫它“根提交”(root commit), 它就代表着项目最初的一个版本(revision).
git 设置用户名
July 22nd, 2011
moonfox $ git config –global user.name "Scott Chacon" $ git config –global user.email "schacon@gmail.com"
git 多人协作,提交流程
July 22nd, 2011
moonfox 提交流程大致如下 $ git clone lyr@192.168.0.7:~/work/m2ge #… 项目开发 … $ git add 改动的文件 $ git commit $ git pull #… 解决版本合并问题 … $ git push
git 多人协作
July 22nd, 2011
moonfox git 协同开发 $ mkdir -p ~/project/m2ge.git $ cd ~/project/m2ge.git $ git –bare init –shared 上述操作中, git-init 命令的 –bare 选项可以让 m2ge.git 目录等价于一个仓 库。 也就是说,m2ge.git 本来是一个工作树, 但是 –bare 选项将本应当存放在 m2ge.git/.git 中的仓库内容全部放置在 m2ge.git 目录下, 就好像仓库完全的裸 露在工作树中, 所以称之为赤裸的仓库。 $ cd ~/work/m2ge $ git push m2@192.168.0.2:~/project/m2ge.git master
rspec expect to
July 19th, 2011
moonfox 期望改变值或抛出异常 expect {}.to change {}.from().to() expect {}.to raise_error(YourMenthodError)
ruby 中 include 与 extend 区别
July 18th, 2011
moonfox 那么include和extend究竟有什么区别的? 引用如下 include : mixes in specified module methods as instance methods in the target class extend : mixes in specified module methods as class methods in the target class 记得有看过的,被用到的时候居然忘记了。杯具啊!
nginx编译选项
March 26th, 2011
moonfox ./configure –prefix=/opt/nginx \ –conf-path=/etc/nginx/nginx.conf \ –error-log-path=/var/log/nginx/error.log \ –pid-path=/var/tmp/nginx/nginx.pid \ –lock-path=/var/lock/nginx.lock \ –user=nginx \ –group=nginx \ –with-http_flv_module \ –with-http_ssl_module \ –add-module=’/opt/passenger/ext/nginx’ \ –with-http_gzip_static_module \ –http-log-path=/var/log/nginx/access.log \ –http-client-body-temp-path=/var/tmp/nginx/client/ \ –http-proxy-temp-path=/var/tmp/nginx/proxy/ \ –http-fastcgi-temp-path=/var/tmp/nginx/fastcgi/ \ –http-scgi-temp-path=/var/tmp/nginx/scgi/ \ –http-uwsgi-temp-path=/var/tmp/nginx/uwsgi/
find_all终成大患了
March 25th, 2011
moonfox 正如之前预料的那样,升级到rails2.3后,find_all终成大患了。其实早在rails 1.2时就已经提示,find_all方法将在2.0版本的时候被移除,所以当时最稳妥的做法就是使用find(:all)这样的原生方法。 # In rails2.0 up can not work find_all(:all) # In rails2.0 still work find(:all)
RSS Feed
Twitter
Posted in
Tags: