Dieses Blog durchsuchen

Samstag, 15. Oktober 2016

git: let git learn how to solve conflicts automaticly: rerere

Once you have solved a conflict, you can git tell to learn from you.
Activate rerere and next time the same conflicts occures git will solve this conflicts automaticly

git config --global rerere.enabled true

git: add a commited file to .gitignore

Everyones, how anoying it is to have files in the remote repository, which has to be on the .gitignorelist.

Git simply ignores every .gitignore entry, wich was committed already.

Here is a simple trick wich helps you out

git update-index --assume-unchanged <filename> 


Freitag, 14. Oktober 2016

laravel 5: json response with

In Laravell 5 PS7 support is missing. So it is a little bit tricky to return a json response with a statuscode and a content type.

Here is a simple controller which does the trick

Montag, 10. Oktober 2016

git: add p4merge as diff and mergetool to console

On windows its useful to use a difftool like p4merge.exe to compare 2 versions of a file.

Lets configure git to use p4merge

Prerequisits

We need some things installed on the local machine.

Edit .gitconfig

open a terminal
git config --global merge.tool p4merge
git config --global mergetool.p4merge.path "<path/to/p4merge.exe>"
git config --global mergetool.prompt false
git config --global diff.tool p4merge
git config --global difftool.p4merge.path "<path/to/p4merge.exe>"
git config --global difftool.prompt false
 
This will make git use p4merge for diff and merging your files visualy

You can test this new difftool by comparing unstaged changes like that:
git difftool
 

git: add a custom shortcut for long commands

Some commands in git are some kind of complicated. Look at this command:
It will simply print the grap history

git log --oneline --graph --decorate

To shorten that, you can setup a alias.

Prerequisits

We need some things installed on the local machine.
  • git bash installed

Add a shortcut

open a terminal
git config --global alias.hist "git log --oneline --graph --decorate"

This will add an alias "hist" to your git console

You can test it with:
git hist

git: add notepadd++ as default editor

If you are on Windows and you want to use notepad++ as the default editor you can follow this instructions 

Prerequisits

We need some things installed on the local machine.
  • git bash installed
  • notepadd++ installed

Add notepadd++ to git config

Open GitBash and type:
git config --global "notepad++ -multiInst -nosession"

You can test it with:
git config --global -e

nginx: tuning nginx and meter performance

Today i found a very good tutorial from Bajamin Cane.
He tunes an nginx x and metered it with ApacheBench

https://blog.codeship.com/tuning-nginx/

And a Second page based on the first:

https://www.webcodegeeks.com/web-development/pregenerating-static-web-pages-better-performance/