css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="container">
  <h1>Git Cheatsheet</h1>
<p class="note">Note: Items contained in [] are optional. All caps words should be replaced, except HEAD.</p>
<ul class="sheet">
    <h3>Just installed Git?</h3>
    <pre class="prettyprint lang-git">git config --global user.name "Your Name"
git config --global user.email "your@email.com"
git config --global color.ui true
git config --global core.autocrlf true</pre>
    <pre class="prettyprint lang-git"># From existing data
git init
git add .
git commit -m "Initial commit."
# From existing repo
git clone ~/existing ~/new
git clone https://USER@HOST.COM/PROJECT.git</pre>
    <pre class="prettyprint lang-git"># View changed files
git status
# View changes
git diff [ID:FILE]
# View changes between commits
git diff ID1 ID2
# View History
git log
# Who did this?
git blame FILE</pre>
    <pre class="prettyprint lang-git">git fetch [REMOTE BRANCH]
# Fetch and merge
git pull [REMOTE BRANCH]</pre>
    <h3>Local work</h3>
    <pre class="prettyprint lang-git"># Add all changes to stage
git add .
# Commit all tracked files
git commit -a [-m "Initial commit."]
# Commit staged changes
git commit
# Unstage file
git reset FILE</pre>
    <pre class="prettyprint lang-git"># View branches
git branch
# Switch between branches
git checkout BRANCH
# Merge branches
git checkout BRANCH2
# Delete local branch
git branch -d BRANCH
# Delete without merging
git branch -D BRANCH
# Delete remote branch
git push REMOTE --delete BRANCH
# Fetch remote branch to local
    <pre class="prettyprint lang-git"># Save a stash
git stash
# View stashes
git stash list
# Apply stash
git stash apply [STASH1]
# Apply and remove
git stash pop
# Clear all stashes
git stash clear</pre>
    <pre class="prettyprint lang-git"># Revert to last commit
git reset --hard HEAD^
# Undo last commit
git reset --soft HEAD^
# Reset file
git checkout -- FILE</pre>
    <pre class="prettyprint lang-git"># Push changes to another repo
git push [REMOTE BRANCH]
# Make a version or milestone
git tag NAME
    <pre class="prettyprint lang-git"># Remove untracked files and directories
git clean -fd
# Check for errors
git fsck</pre>
    <pre class="prettyprint lang-git"># Config format
git config --global alias.co "checkout"

co "checkout"
st "status -sb"
ls "log --pretty=format:'%h: %s'"
df "diff"
ci "commit"
# Usage
git co branch</pre>
    <pre class="prettyprint lang-git"># Archive into a zip file
git archive --format zip --output /full/path/file.zip BRANCH</pre>
<ul class="sheet">
    <h3>Amend commit</h3>
    <pre class="prettyprint lang-git">git commit -m "Initial commit."
git add FILE
git commit --amend</pre>
    <h3>Push to a different remote branch</h3>
    <pre class="prettyprint lang-git">git push REMOTE LOCAL_BRANCH:REMOTE_BRANCH</pre>
    <h3>Access new remote branch</h3>
    <pre class="prettyprint lang-git">git fetch REMOTE REMOTE_BRANCH:LOCAL_BRANCH
git checkout LOCAL_BRANCH</pre>
    <h3>Set upstream</h3>
    <pre class="prettyprint lang-git">git branch --set-upstream BRANCH REMOTE/REMOTE_BRANCH</pre>
    <pre class="prettyprint lang-git"># Untrack file without removing
git rm --cached FILE
# Untrack folder without removing
git rm -r --cached FOLDER/.
    <pre class="prettyprint lang-git"># Ignore file mode changes
git config core.fileMode false
              $text-color: #ddd;
$keyword-color: skyblue;
$string-color: lawngreen;
$comment-color: #999;
$type-color: yellow;

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: "Source Code Pro", "Ubuntu Mono", "Lucida Console", monospace;
  background-color: #122437;
  color: $text-color;
  font-size: 13px;

.note {
  font-size: 80%;
  padding: 6px 0px;
  margin: 0;

.container {
  width: 100%;
  padding: 10px;

h1 {
  margin: 0;
  color: lawngreen;
  font-weight: normal;

h2 {
  margin: 10px 0px 0px;
  font-size: 120%;
  color: tomato;

h3 {
  margin: 16px 0px 0px;
  font-size: 110%;
  color: orange;
  font-weight: normal;
  border-bottom: 1px solid #444;

pre {
  border: 0;
  overflow-x: auto;
  white-space: pre-wrap;

pre .com {
  color: $comment-color;

pre .pln, pre .pun, pre .opn, pre .clo { color:$text-color; }
pre .str { color: $string-color; }
pre .kwd { color:$keyword-color; }
pre .typ { color: $type-color; }
pre .com + .pln { white-space: normal; }
pre.prettyprint { border: 0!important; }
li.L1,li.L3,li.L5,li.L7,li.L9{ background:#3f3f3f!important; }
ol.linenums, li { list-style-type: decimal-leading-zero!important; }

.linenums li {
  border-left: 4px solid #555; 
  padding-left: 10px; 

ul {
  margin: 0;
  padding: 0;
  width: 100%;
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex; 
  -webkit-flex-direction: row;
  flex-direction: row;
  flex-wrap: wrap;
  -webkit-box-pack: flex-start; -moz-box-pack: flex-start; 
  -ms-flex-pack: flex-start; 
  -webkit-justify-content: flex-start;
  justify-content: flex-start;
  -webkit-box-align: flex-start; -moz-box-align: flex-start;
  -ms-flex-align: flex-start;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  list-style-type: none;

ul.sheet > li {
  display: block;
  width: 100%;

@media only screen and (min-width: 800px) {
  body { font-size: 14px; }
  ul.sheet > li { width: 50%; padding: 0 10px; }

@media only screen and (min-width: 1200px) {
  //body { font-size: 24px; }
  ul.sheet > li { width: 33.33%; }
         // Whitespace
         [PR['PR_PLAIN'],       /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
         // A double or single quoted, possibly multi-line, string.
         [PR['PR_STRING'],      /^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/, null,
         // A comment is either a line comment that starts with two dashes, or
         // two dashes preceding a long bracketed block.
         [PR['PR_COMMENT'], /^(?:#[^\r\n]*)/],
          [PR['PR_KEYWORD'], /\b(?:git|list|branch|config|init|clone|status|archive|diff|add|commit|push|pull|stash|remote|apply|pop|reset|clean|fetch|HEAD|clear|tag|checkout|rm|log|blame)\b/, null],
         // An identifier
          [PR['PR_PLAIN'], /^[a-z_][\w-]*/i],
         // A run of punctuation
         [PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................