My Docs
My Blog
Python Data Structures
Repo
Family-Promise-Docs
Search…
Web-Dev-Hub-Docs
Home
Navigation
Tools
Tools
Showcase
Downloads
How To Configure Ubuntu
REPL.IT Compilations
Past Notes
Git
JavaScript
Programming Languages
Programming Languages
What is a Programming Language?
Python
Python
Install PIP
JavaScript
JavaScript
JS-Leetcode
Web Development Frameworks & Libraries
GRAPHQL
React
Jquery
GATSBY
Productivity
Productivity
Misc
Misc
GitGateway
Links
Bookmarks
Websites
Websites
Not My Websites:
Backend
Backend
Networking
Networks
Resources
Resources
Video Resources
General Knowledge
General Knowledge
Knowledge Bank
Finance
Finance
Finance Reference
Financial Trends
Science & Tech (Innovation)
Science & Tech
Articles
Reading
Reading
Social Media & Trends
Trends In Web Dev
FB-Dev-Open Source
IG-API
Docs
Docs
Code Editors & Tools
Vscode
Cool Stuff
Cool Observable Notebooks
Server-Side
GraphQL
Rest VS GraphQl
REST-API
Public APIs
WEB_DEV_TOOLS
Web Dev Tools
Cloudinary
Postman
Netlify
DS_ALGOS_BRAINTEASERS
A Quick Guide to Big-O Notation, Memoization, Tabulation, and Sorting Algorithms by Example
Free-Stuff
Free Stuff
Job-Search
Job Search
Outreach
General Comp Sci
Principles behind the Agile Manifesto
Blockchain & Crypto
Blockchain Basics
Data Structures & Interviewing
Data Structures
REACT_REVISITED
Modern React with Redux
WEBDEV-Bootcamp-Notes
Lambda
Group 1
Testing:
Medium-articles
My Articles
Python For JS Developers
JavaScript Programmer
Awesome Web Development Youtube Video Archive
Bash Commands That Save Me Time and Frustration
Git-Tricks
scrap
Medium Article
Everything You Need To Know About Relational Databases, SQL, PostgreSQL and Sequelize To Build…
Machine Learner
Here’s the expanded list:
The Complete JavaScript Reference Guide
This is really cool!
Web Development Interview Part 3💻
Mutability And Reference VS Privative Types in JavaScript
React
Super Simple Intro To HTML
Introduction to React for Complete Beginners
Web Developer Resource List Part 2
Front End Interview Questions Part 2
A List Of Tools For Improvement
Github Repositories That Will Teach You How To Code For Free!
Libraries
Machine Learner
Here’s the expanded list:
The Complete JavaScript Reference Guide
Powered By
GitBook
Git-Tricks
Refs
​
Awesome GitHub Commands Reference Sheet (Quick Reference)
1
HEAD^ # 1 commit before head
2
HEAD^^ # 2 commits before head
3
HEAD~5 # 5 commits before head
Copied!
Branches
1
# create a new branch
2
git checkout -b $branchname
3
git push origin $branchname --set-upstream
4
​
5
# get a remote branch
6
git fetch origin
7
git checkout --track origin/$branchname
8
​
9
# delete local remote-tracking branches (lol)
10
git remote prune origin
11
​
12
# list merged branches
13
git branch -a --merged
14
​
15
# delete remote branch
16
git push origin :$branchname
17
18
# go back to previous branch
19
git checkout -
Copied!
Collaboration
1
# Rebase your changes on top of the remote master
2
git pull --rebase upstream master
3
4
# Squash multiple commits into one for a cleaner git log
5
# (on the following screen change the word pick to either 'f' or 's')
6
git rebase -i $commit_ref
Copied!
Submodules
1
# Import .gitmodules
2
git submodule init
3
​
4
# Clone missing submodules, and checkout commits
5
git submodule update --init --recursive
6
​
7
# Update remote URLs in .gitmodules
8
# (Use when you changed remotes in submodules)
9
git submodule sync
Copied!
Diff
Diff with stats
1
git diff --stat
2
app/a.txt | 2 +-
3
app/b.txt | 8 ++----
4
2 files changed, 10 insertions(+), 84 deletions(-)
Copied!
Just filenames
1
git diff --summary
Copied!
Log options
1
--oneline
2
e11e9f9 Commit message here
3
​
4
--decorate
5
shows "(origin/master)"
6
​
7
--graph
8
shows graph lines
9
​
10
--date=relative
11
"2 hours ago"
Copied!
Misc
Cherry pick
1
git rebase 76acada^
2
​
3
# get current sha1 (?)
4
git show-ref HEAD -s
5
​
6
# show single commit info
7
git log -1 f5a960b5
8
​
9
# Go back up to root directory
10
cd "$(git rev-parse --show-top-level)"
Copied!
Short log
1
$ git shortlog
2
$ git shortlog HEAD~20.. # last 20 commits
3
​
4
James Dean (1):
5
Commit here
6
Commit there
7
​
8
Frank Sinatra (5):
9
Another commit
10
This other commit
Copied!
Bisect
1
git bisect start HEAD HEAD~6
2
git bisect run npm test
3
git checkout refs/bisect/bad # this is where it screwed up
4
git bisect reset
Copied!
Manual bisection
1
git bisect start
2
git bisect good # current version is good
3
​
4
git checkout HEAD~8
5
npm test # see if it's good
6
git bisect bad # current version is bad
7
​
8
git bisect reset # abort
Copied!
Searching
1
git log --grep="fixes things" # search in commit messages
2
git log -S"window.alert" # search in code
3
git log -G"foo.*" # search in code (regex)
Copied!
GPG Signing
1
git config set user.signingkey <GPG KEY ID> # Sets GPG key to use for signing
2
​
3
git commit -m "Implement feature Y" --gpg-sign # Or -S, GPG signs commit
4
​
5
git config set commit.gpgsign true # Sign commits by default
6
git commit -m "Implement feature Y" --no-gpg-sign # Do not sign
7
---
Copied!
Refs
1
HEAD^ # 1 commit before head
2
HEAD^^ # 2 commits before head
3
HEAD~5 # 5 commits before head
Copied!
Branches
1
# create a new branch
2
git checkout -b $branchname
3
git push origin $branchname --set-upstream
4
​
5
# get a remote branch
6
git fetch origin
7
git checkout --track origin/$branchname
8
​
9
# delete local remote-tracking branches (lol)
10
git remote prune origin
11
​
12
# list merged branches
13
git branch -a --merged
14
​
15
# delete remote branch
16
git push origin :$branchname
17
18
# go back to previous branch
19
git checkout -
Copied!
Collaboration
1
# Rebase your changes on top of the remote master
2
git pull --rebase upstream master
3
4
# Squash multiple commits into one for a cleaner git log
5
# (on the following screen change the word pick to either 'f' or 's')
6
git rebase -i $commit_ref
Copied!
Submodules
1
# Import .gitmodules
2
git submodule init
3
​
4
# Clone missing submodules, and checkout commits
5
git submodule update --init --recursive
6
​
7
# Update remote URLs in .gitmodules
8
# (Use when you changed remotes in submodules)
9
git submodule sync
Copied!
Diff
Diff with stats
1
git diff --stat
2
app/a.txt | 2 +-
3
app/b.txt | 8 ++----
4
2 files changed, 10 insertions(+), 84 deletions(-)
Copied!
Just filenames
1
git diff --summary
Copied!
Log options
1
--oneline
2
e11e9f9 Commit message here
3
​
4
--decorate
5
shows "(origin/master)"
6
​
7
--graph
8
shows graph lines
9
​
10
--date=relative
11
"2 hours ago"
Copied!
Miscellaneous
Cherry pick
1
git rebase 76acada^
2
​
3
# get current sha1 (?)
4
git show-ref HEAD -s
5
​
6
# show single commit info
7
git log -1 f5a960b5
8
​
9
# Go back up to root directory
10
cd "$(git rev-parse --show-top-level)"
Copied!
Short log
1
$ git shortlog
2
$ git shortlog HEAD~20.. # last 20 commits
3
​
4
James Dean (1):
5
Commit here
6
Commit there
7
​
8
Frank Sinatra (5):
9
Another commit
10
This other commit
Copied!
Bisect
1
git bisect start HEAD HEAD~6
2
git bisect run npm test
3
git checkout refs/bisect/bad # this is where it screwed up
4
git bisect reset
Copied!
Manual bisection
1
git bisect start
2
git bisect good # current version is good
3
​
4
git checkout HEAD~8
5
npm test # see if it's good
6
git bisect bad # current version is bad
7
​
8
git bisect reset # abort
Copied!
Searching
1
git log --grep="fixes things" # search in commit messages
2
git log -S"window.alert" # search in code
3
git log -G"foo.*" # search in code (regex)
Copied!
GPG Signing
1
git config set user.signingkey <GPG KEY ID> # Sets GPG key to use for signing
2
​
3
git commit -m "Implement feature Y" --gpg-sign # Or -S, GPG signs commit
4
​
5
git config set commit.gpgsign true # Sign commits by default
6
git commit -m "Implement feature Y" --no-gpg-sign # Do not sign
Copied!
​
#### If you found this guide helpful feel free to checkout my github/gists where I host similar content:
​
bgoonz’s gists · GitHub
​
​
bgoonz — Overview
Web Developer, Electrical Engineer JavaScript | CSS | Bootstrap | Python | React | Node.js | Express | Sequelize…
github.com
​
Or Checkout my personal Resource Site:
​
a/A-Student-Resources
Edit description
goofy-euclid-1cd736.netlify.app
​
By
Bryan Guner
on
March 6, 2021
.
​
Canonical link
​
Exported from
Medium
on August 31, 2021.
Previous
Bash Commands That Save Me Time and Frustration
Next
scrap
Last modified
1d ago
Copy link
Contents
Awesome GitHub Commands Reference Sheet (Quick Reference)
Branches
Collaboration
Submodules
Diff
Diff with stats
Just filenames
Log options
Misc
Cherry pick
Short log
Bisect
Manual bisection
Searching
GPG Signing
Refs
Branches
Collaboration
Submodules
Diff
Diff with stats
Just filenames
Log options
Miscellaneous
Short log
Bisect
Manual bisection
Searching
GPG Signing