*NIX & Hacking —— 第8期



C Programming Substance Guidelines
The International Obfuscated C Code Contest


A Beginners Guide to Docker and Containers


About GCC printf optimization


Git Cheat Sheet
Git Tips


Interfacing the Serial / RS232 Port


Porting Linux to a new processor architecture, part 1: The basics
The newbie’s guide to hacking the Linux kernel
Writing a Linux Kernel Module — Part 1: Introduction


Embedding LuaJIT in 30 minutes (or so)


Mobile TCP optimization – lessons learned in production


The First Port Of Unix

git branch & merge笔记

In fact, in Git, the act of creating a new branch is simply writing a file in the .git/refs/heads directory that has the SHA-1 of the last commit for that branch.

Creating a branch is nothing more than just writing 40 characters to a file.

Switching to that branch simply means having Git make your working directory look like the tree that SHA-1 points to and updating the HEAD file so each commit from that point on moves that branch pointer forward (in other words, it changes the 40 characters in .git/refs/heads/[current_branch_name] be the SHA-1 of your last commit).


Remotes are basically pointers to branches in other peoples copies of the same repository, often on other computers. If you got your repository by cloning it, rather than initializing it, you should have a remote branch of where you copied it from automatically added as origin by default. Which means the tree that was checked out during your initial clone would be referenced as origin/master , which means “the master branch of the origin remote.”

Remotes是指向其它人关于这个repository copy里某个branch的指针。如果你的repository是通过clone其它copy得到的,而不是initialize的,在你的repository里,会自动产生一个origin/masterremote branch指向你copyrepository tree

Git internals