Added vscode settings

This commit is contained in:
Kristofers Solo
2022-04-28 20:54:44 +03:00
parent 245c3ca779
commit 837a479d82
25004 changed files with 2499800 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Language="en-US" Id="git-cheatsheet" Version="1.4.4" Publisher="dzhavat" />
<DisplayName>Git Cheatsheet</DisplayName>
<Description xml:space="preserve">Open a Git Cheatsheet directly in VS Code.</Description>
<Tags>git</Tags>
<Categories>Other,Programming Languages</Categories>
<GalleryFlags>Public</GalleryFlags>
<Properties>
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.58.0" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="workspace" />
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/dzhavat/git-cheatsheet-inside-vs-code.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/dzhavat/git-cheatsheet-inside-vs-code.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/dzhavat/git-cheatsheet-inside-vs-code.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/dzhavat/git-cheatsheet-inside-vs-code/issues" />
<Property Id="Microsoft.VisualStudio.Services.Links.Learn" Value="https://github.com/dzhavat/git-cheatsheet-inside-vs-code#readme" />
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
</Properties>
<License>extension/LICENSE.md</License>
<Icon>extension/assets/images/icon.png</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
</Installation>
<Dependencies/>
<Assets>
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Content.Changelog" Path="extension/CHANGELOG.md" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.md" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/assets/images/icon.png" Addressable="true" />
</Assets>
</PackageManifest>

View File

@@ -0,0 +1,101 @@
# Changelog
## [1.4.4](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.4.3...1.4.4) - 2021-12-19
### Changed
- Set the minimum supported VS Code version to 1.58.0
- Update dependencies
## [1.4.3](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.4.2...1.4.3) - 2021-06-17
### Changed
- Set the minimum supported VS Code version to 1.52.0
- Update dependencies
## [1.4.2](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.4.1...1.4.2) - 2021-02-20
### Fixed
- Fix links to demo gifs
### Changed
- Migrate TSLint to ESLint
- Set the minimum supported VS Code version to 1.47.0
- Update dependencies
- Rename default git branch from `master` to `main`
## [1.4.1](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.4.0...1.4.1) - 2020-10-03
### Added
- An example for how to stash a single file
## [1.4.0](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.3.0...1.4.0) - 2020-09-16
### Added
- New section related to Tags
### Changed
- Update deprecated `git stash save` to `git stash push` command
## [1.3.0](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.2.0...1.3.0) - 2020-09-16
### Added
- Adopt `asWebviewUri` API so the extension will work properly in future versions of VS Code
### Changed
- Consistent param names in git commands
- Update dependencies
- Set the minimum supported VS Code version to 1.44.0
## [1.2.0](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.1.1...1.2.0) - 2020-09-02
### Added
- Four new commands under “Commit History”
### Changed
- Update dependencies
- Set the minimum supported VS Code version to 1.43.0
- Decreased the size of the extension by removing the demo gif from the final package
## [1.1.1](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.1.0...1.1.1) - 2020-03-20
### Changed
- Update dependencies
- Set the minimum supported VS Code version to 1.33.0
## [1.1.0](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/compare/1.0.0...1.1.0) - 2020-01-29
### Added
- Add copy button to each command
## [1.0.1] - 2020-01-21
### Added
- Highlight commands to be more distinguishable
### Fixed
- Fix `git stash` command with message
## [1.0.0](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/releases/tag/1.0.0) - 2020-01-15
- Initial release
### Added
To open the cheatsheet:
- Press `Ctrl+Shift+P` (Win, Linux) / `Cmd+Shift+P` (Mac) and search for the `Open Git Cheatsheet` command.

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Dzhavat Ushev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,27 @@
# Git Cheatsheet ([link](https://marketplace.visualstudio.com/items?itemName=dzhavat.git-cheatsheet))
VS Code extension that lets you open a Git cheatsheet directly in the editor.
## Features
To open the cheatsheet press `Ctrl+Shift+P` (Win, Linux) / `Cmd+Shift+P` (Mac) and search for the `Open Git Cheatsheet` command.
You can also copy each command by clicking on the “Copy” button on the right.
The colors on the cheatsheet page automatically adapt to the selected theme. The font is based on the users preferred font family.
## Support my work
If you find this extension useful and would like to support my work, you can [buy me a cup of tea](https://www.buymeacoffee.com/dzhavat). Thank you!
[![Buy Me A Cup Of Tea](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/raw/main/assets/images/buy-me-a-cup-of-tea.png)](https://www.buymeacoffee.com/dzhavat)
## Demo
#### Using the `Open Git Cheatsheet` command
![Demo](https://github.com/dzhavat/git-cheatsheet-inside-vs-code/raw/main/assets/images/demo.gif)
## Credit
Git Logo by [Jason Long](https://twitter.com/jasonlong) is licensed under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/).

View File

@@ -0,0 +1,44 @@
body {
font-family: var(--vscode-editor-font-family);
margin-left: 3rem;
}
nav {
margin-bottom: 2.5rem;
}
h2 {
margin-bottom: 2rem;
}
p {
line-height: 1.5;
}
.command-wrapper {
position: relative;
}
.command-wrapper + h2 {
margin-top: 3rem;
}
.btn-copy {
background-color: transparent;
border: 0;
color: var(--vscode-menu-selectionForeground);
cursor: pointer;
padding: 4px 8px;
position: absolute;
right: 6px;
top: 6px;
}
pre {
background-color: var(--vscode-menu-selectionBackground);
border-radius: 3px;
color: var(--vscode-menu-selectionForeground);
font-size: 1rem;
margin-bottom: 1.75rem;
padding: 0.5rem 0.75rem;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,12 @@
(function() {
const vscode = acquireVsCodeApi();
const body = document.querySelector('body');
body.addEventListener('click', event => {
if (event.target.nodeName !== 'BUTTON') {
return;
}
vscode.postMessage(event.target.nextElementSibling.textContent);
});
}());

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deactivate = exports.activate = void 0;
const vscode = require("vscode");
const path_1 = require("path");
const webviewContent_1 = require("./webviewContent");
function activate(context) {
let disposable = vscode.commands.registerCommand('open.git.cheatsheet', () => {
const assetsRoot = vscode.Uri.file((0, path_1.join)(context.extensionPath, 'assets'));
const panel = vscode.window.createWebviewPanel('gitCheatsheet', 'Git Cheatsheet', vscode.ViewColumn.Beside, {
localResourceRoots: [assetsRoot],
enableScripts: true
});
const assetsPath = panel.webview.asWebviewUri(assetsRoot);
const cspSource = panel.webview.cspSource;
panel.webview.html = (0, webviewContent_1.getWebviewContent)(cspSource, assetsPath);
panel.webview.onDidReceiveMessage((command) => {
vscode.env.clipboard.writeText(command)
.then(() => {
vscode.window.showInformationMessage(`Command copied: ${command}`);
}, () => {
vscode.window.showErrorMessage('Copy failed');
});
}, undefined, context.subscriptions);
});
context.subscriptions.push(disposable);
}
exports.activate = activate;
function deactivate() { }
exports.deactivate = deactivate;
//# sourceMappingURL=extension.js.map

View File

@@ -0,0 +1,369 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWebviewContent = void 0;
function getWebviewContent(cspSource, assetsPath) {
return /*html*/ `<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src ${cspSource}; script-src ${cspSource}">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Git Cheatsheet</title>
<link rel="stylesheet" href="${assetsPath}/custom.css">
</head>
<body>
<h1>Git Cheatsheet</h1>
<p>Jump to:</p>
<nav>
<ul>
<li><a href="#local-changes" title="Local Changes">Local Changes</a></li>
<li><a href="#branches" title="Branches">Branches</a></li>
<li><a href="#remote-repo" title="Working with a Remote Repository">Working with a Remote Repository</a></li>
<li><a href="#commit-history" title="Commit History">Commit History</a></li>
<li><a href="#rebase" title="Rebase">Rebase</a></li>
<li><a href="#undo" title="Undo">Undo</a></li>
<li><a href="#stash" title="Stash">Stash</a></li>
<li><a href="#tags" title="Tags">Tags</a></li>
<li><a href="#repo-setup" title="Repository Setup">Repository Setup</a></li>
<li><a href="#global-config" title="Global Config">Global Config</a></li>
</ul>
</nav>
<h2 id="local-changes">Local Changes</h2>
<p>Display the status of modified files</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git status</pre>
</div>
<p>Add a file to staging as it looks right now</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git add [file_name]</pre>
</div>
<p>Add a folder to staging as it looks right now</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git add [folder_name]</pre>
</div>
<p>Commit staged files in a new commit</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git commit -m "descriptive_message"</pre>
</div>
<p>Add all files to staging and commit them at once</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git commit -am "descriptive_message"</pre>
</div>
<p>Unstage a file while retaining the changes</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git reset [file_name]</pre>
</div>
<p>Diff of what is changed but not staged</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git diff</pre>
</div>
<p>Diff of what has changed between staged changes and the last commit</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git diff --staged</pre>
</div>
<h2 id="branches">Branches</h2>
<p>List all branches. The current one is marked with <strong>*</strong></p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git branch</pre>
</div>
<p>Create a new branch</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git branch [branch_name]</pre>
</div>
<p>Switch to a branch</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git checkout [branch_name]</pre>
</div>
<p>Create a new branch and switch to it</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git checkout -b [branch_name]</pre>
</div>
<p>Switch to the previously checked out branch</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git checkout -</pre>
</div>
<p>Rename a branch</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git checkout -m [new_branch]</pre>
</div>
<p>Delete a branch, locally</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git branch -d [branch_name]</pre>
</div>
<p>Merge another branch into the current one</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git merge [branch_name]</pre>
</div>
<h2 id="remote-repo">Working with a Remote Repository</h2>
<p>Fetch and merge all commits from the tracked remote branch</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git pull</pre>
</div>
<p>Fetch and merge all commits from a specific remote branch</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git pull [alias] [branch_name]</pre>
</div>
<p>Fetch recent changes from the tracked remote branch but don't merge them</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git fetch</pre>
</div>
<p>Push all local branch commits to the tracked remote branch</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git push</pre>
</div>
<p>Push all local branch commits to a specific remote branch</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git push [alias] [branch_name]</pre>
</div>
<p>Add a new remote repository with the given alias</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git remote add [alias] [repo_url]</pre>
</div>
<p>Display a list of remote repositories and their URLs</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git remote -v</pre>
</div>
<h2 id="commit-history">Commit History</h2>
<p>Show all commits in the current branchs history</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git log</pre>
</div>
<p>Show all commits in the current branchs history by printing each commit on a single line</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git log --oneline</pre>
</div>
<p>Show number of commits per author on all branches, excluding merge commits.</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git shortlog -s -n --all --no-merges</pre>
</div>
<p>Show number of commits per author on a branch, excluding merge commits.</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git shortlog -s -n [branch_name] --no-merges</pre>
</div>
<p>Show number of commits per author on all branches, including merge commits.</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git shortlog -s -n --all</pre>
</div>
<p>Show number of commits per author on a branch, including merge commits.</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git shortlog -s -n [branch_name]</pre>
</div>
<h2 id="rebase">Rebase</h2>
<p>Reapply commits from the current branch on top of another base</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git rebase [branch_name]</pre>
</div>
<p>Abort a rebase</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git rebase -abort</pre>
</div>
<p>Continue a rebase after resolving conflicts</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git rebase -continue</pre>
</div>
<h2 id="undo">Undo</h2>
<p>Revert the changes in a commit and record them in a new commit</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git revert [commit]</pre>
</div>
<p>Reset to a previous commit and preserve the changes made since [commit] as unstaged</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git reset [commit]</pre>
</div>
<p>Reset to a previous commit and discard the changes made since the [commit]</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git reset --hard [commit]</pre>
</div>
<h2 id="stash">Stash</h2>
<p>Stash modified and staged changes</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git stash</pre>
</div>
<p>Stash modified and staged changes with a custom message</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git stash push -m "message"</pre>
</div>
<p>Stash a selected file by specifying a path</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git stash push src/custom.css</pre>
</div>
<p>List all stashed changesets</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git stash list</pre>
</div>
<p>Restore the most recently stashed changeset and delete it</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git stash pop</pre>
</div>
<p>Delete the most recently stashed changeset</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git stash drop</pre>
</div>
<h2 id="tags">Tags</h2>
<p>Create a new tag</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git tag "tagname"</pre>
</div>
<p>List all tags</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git tag</pre>
</div>
<p>Delete a tag</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git tag -d "tagname"</pre>
</div>
<h2 id="repo-setup">Repository Setup</h2>
<p>Create an empty repository in the current folder</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git init</pre>
</div>
<p>Create an empty repository in a specific folder</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git init [folder_name]</pre>
</div>
<p>Clone a repository and add it to the current folder</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git clone [repo_url]</pre>
</div>
<p>Clone a repository to a specific folder</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git clone [repo_url] [folder_name]</pre>
</div>
<h2 id="global-config">Global Config</h2>
<p>Set the username</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git config --global user.name "user_name"</pre>
</div>
<p>Set the user email</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git config --global user.email "user_email"</pre>
</div>
<p>Set automatic command line coloring</p>
<div class="command-wrapper">
<button type="button" class="btn btn-copy">Copy</button>
<pre>git config --global color.ui auto</pre>
</div>
<script src="${assetsPath}/main.js"></script>
</body>
</html>
`;
}
exports.getWebviewContent = getWebviewContent;
//# sourceMappingURL=webviewContent.js.map

View File

@@ -0,0 +1,63 @@
{
"name": "git-cheatsheet",
"displayName": "Git Cheatsheet",
"description": "Open a Git Cheatsheet directly in VS Code.",
"version": "1.4.4",
"engines": {
"vscode": "^1.58.0"
},
"categories": [
"Other",
"Programming Languages"
],
"activationEvents": [
"onCommand:open.git.cheatsheet"
],
"vsce": {
"githubBranch": "main"
},
"license": "MIT",
"icon": "assets/images/icon.png",
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "open.git.cheatsheet",
"title": "Open Git Cheatsheet"
}
]
},
"repository": {
"type": "git",
"url": "https://github.com/dzhavat/git-cheatsheet-inside-vs-code"
},
"publisher": "dzhavat",
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
"test": "node ./out/test/runTest.js",
"lint": "eslint src --ext ts"
},
"devDependencies": {
"@types/glob": "^7.2.0",
"@types/mocha": "^9.0.0",
"@types/node": "14.14.31",
"@types/vscode": "1.58.0",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.5.0",
"glob": "^7.2.0",
"mocha": "^9.1.3",
"typescript": "^4.5.4",
"vscode-test": "^1.6.1"
},
"__metadata": {
"id": "d1470533-e413-458a-a02b-698c1a253763",
"publisherId": "2797277f-872f-4cae-81df-5756e648c817",
"publisherDisplayName": "Dzhavat Ushev",
"isPreReleaseVersion": false,
"installedTimestamp": 1641229758658
}
}