Alessandro Ghedini /dev/random

Make git ignore changes to files

Just another nice feature of git(1) that I always forget about when I need it (it just happened)… posting it here, in the hope that it’ll get stuck in my head.

$ git update-index --assume-unchanged some_file

This will make git to stop tracking the changes to the given file, even if it has already been added to the repository index.

To revert it:

$ git update-index --no-assume-unchanged some_file

And voilà, as if nothing ever happened.

Paolo Pedercini for IGDA Italy

Video postcard made for IGDA’s Italian chapter and Global Game Jam 2011 by Paolo Pedercini (italian only, sorry).

Creating an empty git branch

Sometimes I need to create an empty branch that do not share an ancestor with one of the other branches.

This can be achieved with the following commands:

$ git symbolic-ref HEAD refs/heads/branchname
$ rm .git/index
$ git clean -fd

Or alternatively:

$ git checkout --orphan branchname
$ git rm -rf .

That’s it. Now just do some some work and commit to the branch.

Deleting a tag from remote git repository

Just a quick note for myself:

$ git push :refs/tags/tag_to_delete

That’s all.

Arduino The Documentary

Arduino The Documentary is finally out.

Page 2 of 3