Skip to content

Instantly share code, notes, and snippets.

@petrsvihlik
Last active March 14, 2022 08:01
Show Gist options
  • Save petrsvihlik/b13b995e7d8495c87cfa2c3f44a6eb32 to your computer and use it in GitHub Desktop.
Save petrsvihlik/b13b995e7d8495c87cfa2c3f44a6eb32 to your computer and use it in GitHub Desktop.
Rocky's Personal Cheat-sheet
# Revert commit
git reset --hard <old-commit-id>
git push -f <remote-name> <branch-name>
# Refresh remote branches list
git remote update origin --prune
# Edit last commit message
git commit --amend
git push --force
# Undo the last commit
git reset --soft HEAD~1
# Undo staged files
git reset
# Pull a specific branch from a remote repo
git remote add 'remote_name' 'remote_url'
git pull 'remote_name' 'branch_name'
# WSL2 - https://docs.microsoft.com/en-us/windows/wsl/install-win10
# update system
sudo zypper ref
sudo zypper update
# install .NET https://docs.microsoft.com/en-us/dotnet/core/install/linux-opensuse#opensuse-15-
sudo zypper install libicu
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
wget https://packages.microsoft.com/config/opensuse/15/prod.repo
sudo mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo
sudo chown root:root /etc/zypp/repos.d/microsoft-prod.repo
sudo zypper install dotnet-sdk-5.0
# update system
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo do-release-upgrade
# become root
sudo su -
# check current account
whoami
# change root pwd
sudo passwd root
# Update Node (https://nodejs.org/en/)
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade
# Update NPM packages
# Minor versions only
npm update
# Including major versions
npx npm-check-updates -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment