2010年9月26日 星期日

找出類型為檔案並變更其權限

find . -type f -print -exec chmod -x '{}' \;

註:ecec的結尾一定要是'\;'

2010年9月25日 星期六

把兩個遠端git合併成一個再push回去

會做這件事除了練習git remote之外,當做是一種技巧。

這次主要是把自己寫的vimrcgvimrc和併成一個(成果合併在vimrc這個裡面了)

過程如下:
# 把主要的那個clone下來
git clone git@gist.github.com:171579.git my_vimrc
# 移到目標目錄
cd my_vimrc
# 新增一個新的遠端連接點並tag為gvimrc
git remote add gvimrc git@gist.github.com:171581.git
# 抓取gvimrc內容
git fetch
# 建一個新的branch命名為gvimrc並把遠端指到這個gvimrc
git checkout -b gvimrc gvimrc/master
# 換回master
git checkout master
# 合併gvimrc到master
git merge gvimrc
# 把合併的結果push出去,這會push到vimrc這個
git push

參考文件:

2010年9月20日 星期一

Mac OSX 下專用的 Git ignore file

設定家目錄下的.gitignore為通用設定檔
git config --global core.excludesfile ~/.gitignore

參考一些Xode的暫存檔更新後,內容如下
# Mac OS X Finder and whatnot
.DS_Store
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# no useful files
log/*.log
tmp/**/*
public/cache/**/*
doc/api
doc/app
# Xcode
build/*
*.o
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
# Other source repository archive directories (protects when importing)
.hg
.svn
CVS
# automatic backup files
*~.nib
*.swp
*~
*(Autosaved).rtfd/
Backup[ ]of[ ]*.pages/
Backup[ ]of[ ]*.key/
Backup[ ]of[ ]*.numbers/
# Sparkle distribution Private Key (Don't check me in!)
dsa_priv.pem
## android use
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Eclipse project files
.classpath
.project
# Proguard folder generated by Eclipse
proguard/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
# ctags
TAGS
# Cocoapods
Pods/
podfile.lock
view raw Darwin hosted with ❤ by GitHub
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
view raw Visual Studio hosted with ❤ by GitHub
#ignore thumbnails created by windows
Thumbs.db
view raw Windows hosted with ❤ by GitHub

若有興趣的可以用git抓取原始碼

PS.原來gist也能用git回來或是push回去阿,實在是太有趣了 XD

2010年9月17日 星期五

把iTunes 10的圖示從直式換回橫式

在終端機執行重開即可
defaults write com.apple.iTunes full-window -1

2010年9月14日 星期二

用homebrew裝git+svn

預設定的git沒有git-svn的功能,在這篇文章查到方法
brew install git --with-svn