When working in teams that use branches in git, eventually you're going to get a merge conflict. Most of the time this isn't to much of a problem you just work through the conflicts and commit the changes. From time to time I mess up the merge and I want to just restart resolving the merge conflict again. Thankfully git make it easy if you haven't committed the changes. Just run the command git checkout -m <file name> That's it, you can now try and do the merge again as if you haven't resolved the latest conflict.
As developers we often need to take minified JSON and XML and pretty print it so it is human readable. A multitude of websites provide a free service where you can enter minified JSON or XML and it will format it the data so it is human readable. The problem is this can lead to leaking data causing security incidents. The solution is to write a couple of bash scripts to pretty print. A big thanks to Campovski 's answer on stackoverflow for the JSON and Ben Noland 's answer on stackoverflow and Anton I. Sipos ' comment for the XML I took these answers a little further and created a bash script that accepts arguments so you can pretty print A file The result returned form an API A string Data piped in Both scripts have the same usage Format a file with the -f flag JSON ./pretty_json.sh -f <name_of_file> XML ./pretty_xml.sh -f <name_of_file> Format the return value of an API with the -u flag JSON ./pretty_json.sh -u www.api.com XML ./pretty_xml.sh -u