selfjungle Just another WordPress weblog

25Oct/130

git auto-completion

wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -O ~/.git-completion.bash
source ~/.git-completion.bash
Tagged as: , No Comments
18Oct/130

pushing to a non-bare git repo

Init a directory as a bare repo in the first place:

git init . # non-bare
git init -bare . # bare

To be able to push into a non-bare repo, just check out a branch users don't push to:

git checkout -b DUMMY_BRANCH_DONT_USE

Or turn it into a bare repo:

rm *
mv .git/* .
rm .git
sed -i 's/bare = false/bare = true/' config

Source: gitolite

Tagged as: No Comments
15Oct/130

print range of lines of a file

Print from line N..M from FILE:

sed -n N,Mp FILE
Tagged as: No Comments
15Oct/130

what files does your executable open

strace -e trace=open EXECUTABLE