Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git magic links and some heading updates #2031

Merged
merged 6 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 215 additions & 0 deletions content/languages/git.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,218 @@
short: shell
long: git
name: Git
references:
git add <pathspec>: >-
https://git-scm.com/docs/git-add
git branch: >-
https://git-scm.com/docs/git-branch
git branch --merged <branch>: >-
https://git-scm.com/docs/git-branch#Documentation/git-branch.txt---mergedltcommitgt
git branch --show-current: >-
https://git-scm.com/docs/git-branch#Documentation/git-branch.txt---show-current
git branch --sort=-committerdate: >-
https://git-scm.com/docs/git-branch#Documentation/git-branch.txt---sortltkeygt
git branch -a --merged: >-
https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--a
git branch -d <branch>: >-
https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--d
git branch -m <old-name> <new-name>: >-
https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--m
git branch <branch>: >-
https://git-scm.com/docs/git-branch
git branch <branch> [-t <remote>/<branch>]: >-
https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--t
git bisect (bad | good): >-
https://git-scm.com/docs/git-bisect#_basic_bisect_commands_start_bad_good
git bisect bad <commit>: >-
https://git-scm.com/docs/git-bisect#_basic_bisect_commands_start_bad_good
git bisect good <commit>: >-
https://git-scm.com/docs/git-bisect#_basic_bisect_commands_start_bad_good
git bisect reset: >-
https://git-scm.com/docs/git-bisect#_bisect_reset
git bisect run <command>: >-
https://git-scm.com/docs/git-bisect#_bisect_run
git bisect start: >-
https://git-scm.com/docs/git-bisect#_basic_bisect_commands_start_bad_good
git checkout: >-
https://git-scm.com/docs/git-checkout
git checkout -: >-
https://git-scm.com/docs/git-checkout
git checkout -b <branch>: >-
https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt--bltnew-branchgt
git checkout <branch>: >-
https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt-ltbranchgt
git checkout <branch> <file>: >-
https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt-ltpathspecgt82308203
git checkout <commit>^ -- <file>: >-
https://git-scm.com/docs/git-checkout
git checkout <new-name>: >-
https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt-ltnew-branchgt
git checkout master: >-
https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt-ltbranchgt
git cherry-pick <commit-1> <commit-2>...: >-
https://git-scm.com/docs/git-cherry-pick
git cherry-pick <commit>: >-
https://git-scm.com/docs/git-cherry-pick
git cherry-pick <first-commit>..<last-commit>: >-
https://git-scm.com/docs/git-cherry-pick
git clean -f -d: >-
https://git-scm.com/docs/git-clean
git clone <url>: >-
https://git-scm.com/docs/git-clone
git clone <url> [<directory>]: >-
https://git-scm.com/docs/git-clone#Documentation/git-clone.txt-ltdirectorygt
git commit: >-
https://git-scm.com/docs/git-commit
git commit --allow-empty -m <message>: >-
https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---allow-empty
git commit --fixup <commit>: >-
https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---fixupamendrewordltcommitgt
--fixup: >-
https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---fixupamendrewordltcommitgt
git commit --no-verify -m <message>: >-
https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---no-verify
git commit -m <message>: >-
https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--mltmsggt
git commit --amend: >-
https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---amend
git config: >-
https://git-scm.com/docs/git-config
git config --add merge.ff false: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt---add
git config --get remote.origin.url: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt---get
git config --global -e: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt--e
git config --global core.editor <editor-command>: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreeditor
git config --global help.autocorrect 1: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt-helpautoCorrect
git config -l: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt--l
git config commit.template <file>: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt-committemplate
git config core.eol [lf | crlf]: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreeol
git config push.default current: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault
git config user.email <email>: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt-useremail
git config user.name <name>: >-
https://git-scm.com/docs/git-config#Documentation/git-config.txt-username
git diff: >-
https://git-scm.com/docs/git-diff
git diff <branch>..<other-branch>: >-
https://git-scm.com/docs/git-diff
git fetch: >-
https://git-scm.com/docs/git-fetch
git fetch --all --prune: >-
https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---prune
git fetch origin: >-
https://git-scm.com/docs/git-fetch
git filter-branch --force --index-filter <command> --prune-empty --tag-name-filter cat -- --all: >-
https://git-scm.com/docs/git-filter-branch
git fsck --lost-found: >-
https://git-scm.com/docs/git-fsck
git gc --prune=now --aggressive: >-
https://git-scm.com/docs/git-gc
git init: >-
https://git-scm.com/docs/git-init
git init [<directory>]: >-
https://git-scm.com/docs/git-init
git log: >-
https://git-scm.com/docs/git-log
git log --author=<author>: >-
https://git-scm.com/docs/git-log#Documentation/git-log.txt---authorltpatterngt
git log --pretty=oneline --graph --decorate --all: >-
https://git-scm.com/docs/git-log#Documentation/git-log.txt---prettyltformatgt
git log --since=<date-from> --until=<date-to>: >-
https://git-scm.com/docs/git-log#Documentation/git-log.txt---sinceltdategt
git log -1: >-
https://git-scm.com/docs/git-log
git log -S<string>: >-
https://git-scm.com/docs/git-log#Documentation/git-log.txt--Sltstringgt
git merge: >-
https://git-scm.com/docs/git-merge
--no-ff: >-
https://git-scm.com/docs/git-merge#Documentation/git-merge.txt---no-ff
git pull: >-
https://git-scm.com/docs/git-pull
git push: >-
https://git-scm.com/docs/git-push
git push -d <remote> <branch>: >-
https://git-scm.com/docs/git-push#Documentation/git-push.txt--d
git push -f: >-
https://git-scm.com/docs/git-push#Documentation/git-push.txt--f
git push <remote> --force -all: >-
https://git-scm.com/docs/git-push#Documentation/git-push.txt---force
git push origin --delete <old-name>: >-
https://git-scm.com/docs/git-push#Documentation/git-push.txt---delete
git push origin -u <new-name>: >-
https://git-scm.com/docs/git-push#Documentation/git-push.txt--u
git rebase: >-
https://git-scm.com/docs/git-rebase
git rebase --abort: >-
https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---abort
git rebase --autosquash: >-
https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---autosquash
--autosquash: >-
https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---autosquash
git rebase --continue: >-
https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---continue
git rebase -i <commit>: >-
https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt--i
git rebase <base-branch>: >-
https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt-ltbranchgt
git reflog: >-
https://git-scm.com/docs/git-reflog
git remote set-url origin <url>: >-
https://git-scm.com/docs/git-remote
git reset: >-
https://git-scm.com/docs/git-reset
git reset --hard HEAD: >-
https://git-scm.com/docs/git-reset#Documentation/git-reset.txt---hard
git reset --hard origin/master: >-
https://git-scm.com/docs/git-reset#Documentation/git-reset.txt---hard
git reset HEAD~<n> --hard: >-
https://git-scm.com/docs/git-reset#Documentation/git-reset.txt---hard
git restore --staged <pathspec>: >-
https://git-scm.com/docs/git-restore
git rev-parse --abbrev-ref HEAD: >-
https://git-scm.com/docs/git-rev-parse
git revert: >-
https://git-scm.com/docs/git-revert
git revert HEAD: >-
https://git-scm.com/docs/git-revert
git rm --cached --ignore-unmatch <path>: >-
https://git-scm.com/docs/git-rm#Documentation/git-rm.txt---cached
git rm -f <submodule>: >-
https://git-scm.com/docs/git-rm#Documentation/git-rm.txt--f
git rm --cached <file>: >-
https://git-scm.com/docs/git-rm#Documentation/git-rm.txt---cached
git shortlog <commit>..<other-commit>: >-
https://git-scm.com/docs/git-shortlog
git stash apply: >-
https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-apply--index-q--quietltstashgt
git stash apply <stash>: >-
https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-apply--index-q--quietltstashgt
git stash clear: >-
https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-clear
git stash drop <stash>: >-
https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-drop-q--quietltstashgt
git stash list: >-
https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-listltlog-optionsgt
git stash save: >-
https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-save-p--patch-S--staged-k--no-keep-index-u--include-untracked-a--all-q--quietltmessagegt
git status: >-
https://git-scm.com/docs/git-status
git submodule add <upstream-path> <local-path>: >-
https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-add-bltbranchgt-f--force--nameltnamegt--referenceltrepositorygt--depthltdepthgt--ltrepositorygtltpathgt
git submodule deinit -f -- <submodule>: >-
https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-deinit-f--force--all--ltpathgt82308203
git submodule update --init --recursive: >-
https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-update--init--remote-N--no-fetch--no-recommend-shallow-f--force--checkout--rebase--merge--referenceltrepositorygt--depthltdepthgt--recursive--jobsltngt--no-single-branch--filterltfilterspecgt--ltpathgt82308203
git submodule update --recursive --remote: >-
https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-update--init--remote-N--no-fetch--no-recommend-shallow-f--force--checkout--rebase--merge--referenceltrepositorygt--depthltdepthgt--recursive--jobsltngt--no-single-branch--filterltfilterspecgt--ltpathgt82308203
git switch <branch>: >-
https://git-scm.com/docs/git-switch
2 changes: 1 addition & 1 deletion content/snippets/git/s/purge-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Completely purges a file from history.
- Use `git rm --cached --ignore-unmatch <path>` to delete the file in the specified `<path>`.
- Use `git filter-branch --force --index-filter <command> --prune-empty --tag-name-filter cat -- --all` to rewrite the branch's history, passing it the previous command.
- You can optionally use `git push <remote> --force -all` to force push the changes to the remote repository.
- ⚠️ **WARNING**: This is a destructive action that rewrites the history of the entire repository. Make sure you know what you are doing.
- **WARNING**: This is a destructive action that rewrites the history of the entire repository. Make sure you know what you are doing.

```shell
git filter-branch --force --index-filter \
Expand Down
13 changes: 7 additions & 6 deletions content/snippets/git/s/remove-file-from-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ title: Remove a file from the last commit
type: snippet
language: git
tags: [commit]
author: chalarangelo
cover: cancel-typographer
dateModified: 2021-04-13
---

Removes a file from the last commit without changing its message.

- Use `git rm -cached <file>` to remove the specified `<file>` from the index.
- Use `git commit -amend` to update the contents of the last commit, without changing its message.
- Use `git rm --cached <file>` to remove the specified `<file>` from the index.
- Use `git commit --amend` to update the contents of the last commit, without changing its message.

```shell
git rm -cached <file>
git commit -amend
git rm --cached <file>
git commit --amend
```

```shell
git rm -cached "30-seconds.txt"
git commit -amend
git rm --cached "30-seconds.txt"
git commit --amend
# Removes `30-seconds.txt` from the last commit
```
2 changes: 1 addition & 1 deletion content/snippets/git/s/view-undo-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ excerpt: Learn how to view your "undo" history using git reflog and reset your r
dateModified: 2023-05-21
---

Sometimes, `git log` doesn't cut it, especially for commands that don't show up in your commit history. Fortunately, there's a way to view your **"undo" history**. `reflog` is basically your safety net after running "scary" commands like `git rebase`. It allows you to see not only the commits you made, but each of the actions that led you there.
Sometimes, `git log` doesn't cut it, especially for commands that don't show up in your commit history. Fortunately, there's a way to view your **"undo" history**. `git reflog` is basically your safety net after running "scary" commands like `git rebase`. It allows you to see not only the commits you made, but each of the actions that led you there.

To view you "undo" history, you can use `git reflog`, which displays the git reference log:

Expand Down
6 changes: 3 additions & 3 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const currentYear = new Date().getFullYear();
<a href='/faq'>FAQ</a>
<a href='/feed'>RSS</a>
<a
href={settings.githubOrgUrl}
href={settings.githubRepoUrl}
rel='noopener noreferrer nofollow'
target='_blank'>GitHub</a
>
Expand All @@ -20,9 +20,9 @@ const currentYear = new Date().getFullYear();
Website, name & logo &copy; 2017-{currentYear}
<a
class='inline-block ml-1'
href={settings.githubOrgUrl}
href={settings.ownerUrl}
rel='noopener noreferrer nofollow'
target='_blank'>{settings.orgName}</a
target='_blank'>{settings.ownerName}</a
>
<br />
Individual snippets licensed under
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[lang]/[...listing].astro
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const {
/>
</div>
<div>
<h2 class={prefabs.listingTitle}>{collection.name}</h2>
<h1 class={prefabs.listingTitle}>{collection.name}</h1>
<p class='lh-loose mt-4 mx-3.5 mb-2 txt-100 fs-sm md:fs-md'>
{collection.description}
</p>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/about.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import prefabs from '#prefabs';
import settings from '#settings/global';

import Layout from '#layouts/Layout';

Expand Down Expand Up @@ -31,9 +32,9 @@ const pageDescription =
<div class='card-description'>
<p>
30 seconds of code is developed, maintained and curated by <a
href='https://github.com/Chalarangelo'
href={settings.ownerUrl}
target='_blank'
rel='noopener noreferrer'>Angelos Chalaris</a
rel='noopener noreferrer'>{settings.ownerName}</a
>. I'm a professional software engineer, based in Greece, and 30
seconds of code is a side project I work on in my free time. My love
for development and learning is what sparkled this idea and I've put a
Expand Down
4 changes: 3 additions & 1 deletion src/settings/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ export default {
websiteName: '30 seconds of code',
websiteDescription: 'Short code snippets for all your development needs',
shortName: '30s',
ownerName: 'Angelos Chalaris',
ownerUrl: 'https://github.com/Chalarangelo',
orgName: '30 seconds of code',
websiteUrl: 'https://www.30secondsofcode.org',
githubOrgUrl: 'https://github.com/30-seconds',
githubRepoUrl: 'https://github.com/30-seconds/30-seconds-of-code',
licenseUrl: 'https://creativecommons.org/licenses/by/4.0/',
googleSiteVerification: 'YX9mF-TxoHZGJ9SZ8XwvWgGR_KTcbH1uHul4iDklyr0',
googleAnalytics: {
Expand Down
Loading