Create a diff or patch file on GitHub

December 25th, 2017 | #git #github

Ever needed to email a commit to someone? Well, today I did. TIL how to quickly generate a diff or patch file for a commit page, Pull Request or a Compare View.

Read more

Do not commit sensitive data to public repositories

November 15th, 2017 | #git #github

Stupid title, right? You probably think it is obvious to not commit sensitive data to public repositories. Well, it is obvious—sort of.

Read more

Optimise local repositories with Git Garbage Collection

November 9th, 2017 | #git

TIL how to optimise local repositories with Git Garbage Collection.

$ git gc
Counting objects: 1278, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (1068/1068), done.
Writing objects: 100% (1278/1278), done.
Total 1278 (delta 234), reused 1096 (delta 102)
Read more

Delete local branches that are merged into HEAD and deleted on remote

November 8th, 2017 | #git #terminal

TIL how to delete local branches that are merged into HEAD and deleted on remote.

git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
Read more

© 2018 Tonny Garić | With from Nijmegen, The Netherlands