Skip to content

Commit

Permalink
➕ add cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
devmount committed Apr 15, 2021
1 parent 8d44325 commit 77a2768
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 89 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ Repository for everything I look up more than twice

## TOC

- [Bash](./bash.md)
- [Git](./git.md)
- [NPM](./npm.md)
- [Visual Studio Code](./vscode.md)
- [Yarn](./yarn.md)
- [Bash](./sheets/bash.md)
- [cmd](./sheets/cmd.md)
- [Git](./sheets/git.md)
- [NPM](./sheets/npm.md)
- [Visual Studio Code](./sheets/vscode.md)
- [Yarn](./sheets/yarn.md)

## External Cheat Sheets

Expand Down Expand Up @@ -47,6 +48,7 @@ In addition to my own above, I compiled a list of the (in my opinion) best Cheat
- <https://www.educba.com/c-programming-language-basics/>

#### Dotnet

- <https://github.com/quozd/awesome-dotnet>
- <https://github.com/thangchung/awesome-dotnet-core>

Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions sheets/cmd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# cmd

## Symlink

Create a symbolic link e.g. for XAMPP's htdocs directory:

```cmd
mklink /D symlink-name c:\Users\user\data\git\project\
```

Note: The `/D` is there because we are linking to a directory. `symlink-name` is the name of the symbolic link. Finally, the path is where the symbolic link actually resolves to.
168 changes: 84 additions & 84 deletions git.md → sheets/git.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
# Git

## Setup

### Git global setup

git config --global user.name "Prename Name"
git config --global user.email "email@example.com"

Just remove the `--global` flag for local setup.

### Create a new repository

git clone https://user@github.com/user/repo.git
cd repo
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

### Existing folder

cd existing_folder
git init
git remote add origin https://user@github.com/user/repo.git
git add .
git commit
git push -u origin master

### Existing Git repository

cd existing_repo
git remote add origin https://user@github.com/user/repo.git
git push -u origin --all
git push -u origin --tags

### Update remote location

```bash
git remote rm origin
git remote add origin <new-location>
git branch --set-upstream-to=origin/master master
```

### Stop tracking file

```bash
git update-index --assume-unchanged [path]
```

## Remove password prompt

Caution: this will store the password unencrypted on the disk! Only use if it's safe on your machine!

git config credential.helper store

## Sign/verify commits

Use `git commit -S` by default for all commits

git config --global commit.gpgsign true

Set default key

git config --global user.signingkey <key-id>

## Tags

### Add tag to specific commit

git tag -a v[version] [hash] -m "your tag description"

## Branches

### Remove Branches

git branch -d local-branch-name
git remote prune origin

## Submodules

Pull all submodules of the current repository (as they will not automatically retrieved by a `git clone`)

git submodule update --init --recursive
# Git

## Setup

### Git global setup

git config --global user.name "Prename Name"
git config --global user.email "email@example.com"

Just remove the `--global` flag for local setup.

### Create a new repository

git clone https://user@github.com/user/repo.git
cd repo
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

### Existing folder

cd existing_folder
git init
git remote add origin https://user@github.com/user/repo.git
git add .
git commit
git push -u origin master

### Existing Git repository

cd existing_repo
git remote add origin https://user@github.com/user/repo.git
git push -u origin --all
git push -u origin --tags

### Update remote location

```bash
git remote rm origin
git remote add origin <new-location>
git branch --set-upstream-to=origin/master master
```

### Stop tracking file

```bash
git update-index --assume-unchanged [path]
```

## Remove password prompt

Caution: this will store the password unencrypted on the disk! Only use if it's safe on your machine!

git config credential.helper store

## Sign/verify commits

Use `git commit -S` by default for all commits

git config --global commit.gpgsign true

Set default key

git config --global user.signingkey <key-id>

## Tags

### Add tag to specific commit

git tag -a v[version] [hash] -m "your tag description"

## Branches

### Remove Branches

git branch -d local-branch-name
git remote prune origin

## Submodules

Pull all submodules of the current repository (as they will not automatically retrieved by a `git clone`)

git submodule update --init --recursive
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 77a2768

Please sign in to comment.