-
git diff View difference between Stage and Working Directory
-
git diff --staged View difference between HEAD and Stage
-
git diff HEAD View difference between HEAD and Working Directory
-
origin refers to the source repository from where it was cloned.
-
HEAD is a reference to the last commit in the currently checked-out branch.
-
Staged and index both are same
-
Unstaged changes exist in our Working Directory, but Git hasnโt recorded them into its version history yet.
-
Staged changes are a lot like unstaged changes, except that theyโve been marked to be committed the next time you run git commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git checkout master | |
| git pull | |
| git checkout 666-my-evil-branch | |
| git checkout master | |
| git merge --squash 666-my-evil-branch | |
| git commit -nv | |
| git checkout -b 666-my-evil-branch-clean | |
| git push -u origin 666-my-evil-branch-clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git checkout master file | |
| git status | |
| git add file | |
| git commit -m "reverted file" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git checkout master | |
| git pull | |
| git checkout 666-my-evil-branch | |
| # are you really on the right branch? | |
| git branch | |
| # is everything in the right state? | |
| git status | |
| # do it | |
| git merge master | |
| # fix problems |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openssl crl2pkcs7 -nocrl -certfile /usr/lib/ssl/certs/ca-certificates.crt \ | |
| | openssl pkcs7 -print_certs -text -noout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scp /etc/resolv.conf host:/tmp | |
| ssh -t host "sudo mv /tmp/resolv.conf /etc \ | |
| && sudo systemctl disable systemd-resolved \ | |
| && sudo systemctl stop systemd-resolved \ | |
| && host google.com" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -x | |
| # install packages | |
| sudo apt install snmp snmpd snmp-mibs-downloader -y -qq | |
| # create config file | |
| cat > /tmp/snmpd.conf << EOF | |
| # Listen for connections on all interfaces (IPv4 only) | |
| agentAddress udp:161 |