Nasrul Hazim Bin Mohamad

Git: Undo


Here are some undo commands, depending on situation.

# To go back to staging from commit
git reset --soft HEAD~

# Unstaging
git reset HEAD <file>

# Undo Changes Made to the File
git checkout -- <file>

Git: How to Sync Fork with Master


You have forked numbers of repositories, but have no idea how to merge with the master copy if there’s changes. So here the solution.

# Add Upstream Remote
git remote add upstream [URL]

# Fetch Upstream
git fetch upstream

# Checkout master (your fork repo & in case you're not in master branch yet)
git checkout master

# Merge
git merge upstream/master

# Push to Fork
git push origin master

Laranix: Just like Laragon


Having an issue with Laravel installer on Ubuntu, ended up writing small bash script which can:

  1. Create new Laravel project
  2. Change bootstrap/cache & storage to writeable
  3. Create VirtualHost automatically (using RoverWire/virtualhost)

This small script similar to Laragon, but this one for Linux users. 🙂

Grab the script here to simplify your work with Laravel!