Programming

33 articles

Git: push/pull new branches to/from a remote repository

To push the branch newbranch to the remote repository origin: $ git push -u origin newbranch The -u option (we can also use the more verbose --set-upstream option) tells Git to also track this branch, thus allowing us to pull automatically future upstream commits using git pull. To pull the…

PHP: write var_dump output directly into a log file

I just encountered a bug in a production environment that I could not reproduce in development. In order to debug it without disrupting the users, I used the following snippet to directly send the debug output into a log file. Prefer var_dump to print_r as it would transform NULL and booleans…

Git: untrack files without deleting them

$ git rm --cached pattern The pattern can be a filename or a file glob pattern like folderName/* to untrack all the files in folderName.