Sat, 17 Nov 2012

Git cheatsheet

Keywords: git

Merge newer changes on the branch you came from (eg master):

$ git rebase master

Merge your branch:

$ git merge [--no-ff] newbranch

Push a newly created branch upstream:

$ git push -u origin newbranch

-u makes your branch a tracking branch of upstream


Create a new tracking branch:

$ git branch -t newbranch origin/newbranch

Delete remote-tracking branch:

$ git branch -r -d origin/oldbranch

Delete remote branch: (see also

$ git push origin --delete oldbranch

Rewrite history:

$ git rebase -i HEAD~5

Make a branch retroactively (see

$ git checkout -b newbranch
$ git update-ref refs/heads/master origin/master

Merge a branch that should have been rebased:

$ git fetch upstream_branch:local_newbranch
$ git checkout local_newbranch
$ git rebase master
$ git checkout master
$ git merge -ff-only local_newbranch
$ git branch -d local_newbranch

Create a branch for a pull request:

$ git pull upstream_branch:local_newbranch

Move a branch to a new commit:

$ git branch -f branch_name new_tip_commit

Look at a file from an previous revision:

$ git cat-file -p <sha1>:filename

[/revision_control] permanent link

Fri, 27 Jan 2012

Ubuntu and Notion

Keywords: linux ubuntu notion

I use Notion as my window manager under Ubuntu. Notion is a fork of Ion.

Under Ubuntu 11.10 you can set Notion as your default window manager by creating the file /usr/share/xsessions/notion.desktop with the contents:

[Desktop Entry]
Comment=This session logs you into Notion

Then edit /etc/lightdm/lightdm.conf:


and if you want to automatically login set:


where XXX is your username.

[/unix] permanent link

September 2017
Sun Mon Tue Wed Thu Fri Sat