venerdì, marzo 16, 2018

Git Handbook

How to setup git with SSH Key

# git remote set-url origin [email protected]:<Username>/<Project>.git

Windows CRLF chars.

Su windows bisogna disattivare questa funziona altrimenti non funzionano i caratteri CRLF.
# git config core.autocrlf false

How can I debug git/git-shell related problems?

If you have problem with Git and you need to debug you can run this:


How to get list of files between change log ?

If you need to get list of files (included directory tree) from change list you can use:

# git diff-tree -r --name-only 2c636a^ 5b47402 | xargs -I {} rsync -aR {} output/

Delete files from git index when they are already deleted

# git ls-files --deleted -z | xargs -0 git rm

How do I show my global git config?

# git config --list

Show remote branches

# git branch -vr

Filename too long in git for windows

git config --system core.longpaths true

Note: You need to run as administrator.


List log with tag date

git log --date-order --graph --tags --simplify-by-decoration --pretty=format:'%ai %h %d'

venerdì, marzo 02, 2018

How to improve reading of log files

There are hard times when a sysadmin have to read a lot of rows of log files for troubleshoot a system error. In this times can be helpful to use some tools to improve reading of these files.

I've found two tools:

  • Generic Colouriser (GRC) - there are programs: grc and grcat. The main is grcat, which acts as a filter, i.e. taking standard input, colourising it and writing to standard output. Then you can use configuration files for customize color ouput depend on you application output log. 
  • Log File Navigator (LNAV) - this is a real log file navigator that parse content of file and follow the stream for read latest lines. Lnav can help highlight the parts that are important and filter out the noise.