Last active
April 5, 2025 12:16
-
-
Save DannyQuah/5f43f9b75970bc4e357e42c7c9214b5d to your computer and use it in GitHub Desktop.
Revisions
-
DannyQuah revised this gist
Jan 12, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -65,7 +65,7 @@ $ git push myGist master # to gist Prosper. (As far as I have been able to tell `gist.github.com` continues to use `master` as the primary branch while since Oct 2020 `github.com` itself has switched to `main`.) -
DannyQuah renamed this gist
Jan 12, 2022 . 1 changed file with 17 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,24 @@ # Managing Gists Locally by Danny Quah, May 2020 (revised Jan 2022) Through the Embed instruction or plugin, Gist snippets on GitHub can conveniently provide posts on Medium, WordPress, and elsewhere supplementary information (lines of code, images, Markdown-created tables, and so on). But while Gist snippets on GitHub can be managed directly via browser or through something like [Gisto][], a user might also wish to manipulate them offline. This last is for many of the same reasons that a user seeks to clone a git repo to their local filesystem, modify it locally, and then only subsequently push changes back up to GitHub. Here's how to do this: Create the gist on GitHub and then clone it to your local filesystem: ``` $ git clone https://gist.github.com/DannyQuah/5f43f9b75970bc4e357e42c7c9214b5d ``` Locally, rename that folder however you wish (or just leave it as that long string): ``` $ mv -i 5f43f9b75970bc4e357e42c7c9214b5d YYYY.MM-Author-Subject ``` Work on the file inside `YYYY.MM-Author-Subject/`; and then, whenever ready, as usual do: ``` $ # changes ... @@ -36,7 +36,7 @@ Using the feature that a git repo on the local filesystem can be associated with (In the sequel, anything that begins `my` should be named however the user prefers.) After the steps, above also create on GitHub a new git repo `myGistProject`; then from inside `YYYY.MM-Author-Subject/` add that new GitHub repo as a remote, labelling it `myGitHub` for git use, i.e., ``` $ git remote add myGithub https://github.com/DannyQuah/myGistProject @@ -45,7 +45,7 @@ $ git remote add myGithub https://github.com/DannyQuah/myGistProject Push to the new repository on GitHub ``` $ git push myGithub main ``` Keep things parallel by renaming the remote of the Gist snippet: `origin` is where this had come from, so now instead call it `myGist` @@ -59,12 +59,14 @@ Now each time push either to myGithub or myGist (or both, obviously): ``` $ # changes $ git commit -m "The new changes" $ git push myGithub main # to github $ git push myGist master # to gist ``` Prosper. (As far as I have been able to tell `gists.github.com` continues to use `master` as the primary branch while since Oct 2020 `github.com` itself has switched to `main`.) References: @@ -80,3 +82,6 @@ References: <!--- Invisible section // Quah-D-2020.05-Managing-Gists-Locally.md --> -
DannyQuah revised this gist
Jun 5, 2020 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,11 +26,17 @@ $ git commit -m "The new changes" $ git push ``` ### Putting the Gist on GitHub additionally You can leave this as above. But you can also get fancier. Using the feature that a git repo on the local filesystem can be associated with multiple remotes on GitHub, it is possible, alternatively and optionally, to save both a gist and a git repo on GitHub. Doing so follows [Ishu3101][]. (In the sequel, anything that begins `my` should be named however the user prefers.) After the steps, above also create on GitHub a new git repo `myGistProject`; then from inside `localGistFolder/` add that new GitHub repo as a remote, labelling it `myGitHub` for git use, i.e., ``` $ git remote add myGithub https://github.com/DannyQuah/myGistProject -
DannyQuah revised this gist
May 9, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ by Danny Quah, May 2020 Through the Embed instruction or plugin, Gist snippets on GitHub can conveniently provide posts on Medium, WordPress, and elsewhere supplementary information (lines of code, images, Markdown-created tables, and so on). But while Gist snippets on GitHub can be managed directly via browser or through something like [Gisto][], a user might also wish to manipulate them offline. This last is for many of the same reasons that a user seeks to clone a git repo to their local filesystem, modify it locally, and then only subsequently push changes back up to GitHub. Here's how to do this: -
DannyQuah revised this gist
May 9, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,7 @@ Push to the new repository on GitHub $ git push myGithub master ``` Keep things parallel by renaming the remote of the Gist snippet: `origin` is where this had come from, so now instead call it `myGist` ``` $ git remote rename origin myGist -
DannyQuah revised this gist
May 9, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ $ mv -i 5f43f9b75970bc4e357e42c7c9214b5d localGistFolder Work on the file inside `localGistFolder/`; and then, whenever ready, as usual do: ``` $ # changes ... $ git commit -m "The new changes" $ git push ``` @@ -57,7 +57,7 @@ $ git push myGithub master # to github $ git push myGist master # to gist ``` Prosper. -
DannyQuah revised this gist
May 9, 2020 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -68,7 +68,6 @@ References: [Gisto]: https://www.gistoapp.com/ [Ishu3101]: https://gist.github.com/ishu3101/830b556b487de5d69690 -
DannyQuah revised this gist
May 9, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ **Managing Gists Locally** by Danny Quah, May 2020 Through the Embed instruction or plugin, Gist snippets on GitHub can conveniently provide posts on Medium, WordPress, and elsewhere supplementary information (images, Markdown-created tables, and so on). But while Gist snippets on GitHub can be managed directly via browser or through something like [Gisto][], a user might also wish to manipulate them offline. This last is for many of the same reasons that a user seeks to clone a git repo to their local filesystem, modify it locally, and then only subsequently push changes back up to GitHub. -
DannyQuah revised this gist
May 9, 2020 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ **Managing Gists Locally** by Danny Quah, May 2020 Through the Embed instruction or plugin, Gist snippets on GitHub can conveniently provide posts on Medium, WordPress, and elsewhere supplementary information (images, Markdown-created tables, and so on). But while Gist snippets on GitHub can be managed directly via browser or through something like [Gisto][], a user might also wish to manipulate them offline. This last is for many of the same reasons that a user seeks to clone a git repo to their local filesystem, modify it locally, and then only subsequently push changes back up to GitHub. -
DannyQuah revised this gist
May 9, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,13 +9,13 @@ Here's how to do this: Create the gist on GitHub and then clone it to your local filesystem: ``` $ git clone https://gist.github.com/DannyQuah/5f43f9b75970bc4e357e42c7c9214b5d ``` Locally, rename that folder however you wish (or just leave it as that long string): ``` $ mv -i 5f43f9b75970bc4e357e42c7c9214b5d localGistFolder ``` Work on the file inside `localGistFolder/`; and then, whenever ready, as usual do: -
DannyQuah created this gist
May 9, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,77 @@ Managing Gists Locally by Danny Quah, May 2020 Through the Embed instruction or plugin, Gist snippets on GitHub can conveniently provide posts on Medium, WordPress, and elsewhere supplementary information (images, Markdown-created tables, and so on). But while Gist snippets on GitHub can be managed directly via browser or through something like [Gisto][], a user might also wish to manipulate them offline. This last is for many of the same reasons that a user seeks to clone a git repo to their local filesystem, modify it locally, and then only subsequently push changes back up to GitHub. Here's how to do this: Create the gist on GitHub and then clone it to your local filesystem: ``` $ git clone https://gist.github.com/DannyQuah/091ed0cfbfee8a1ead01412f4735410b ``` Locally, rename that folder however you wish (or just leave it as that long string): ``` $ mv -i 091ed0cfbfee8a1ead01412f4735410b localGistFolder ``` Work on the file inside `localGistFolder/`; and then, whenever ready, as usual do: ``` $ # changes $ git commit -m "The new changes" $ git push ``` Using the feature that a git repo on the local filesystem can be associated with multiple remotes on GitHub, it is possible also, alternatively and optionally, to get fancy by saving both a gist and a git repo on GitHub. Doing so follows [Ishu3101][]. (In the sequel, anything that begins `my` should be named however the user prefers.) After the steps above also create on GitHub a new git repo `myGistProject`; then from inside `localGistFolder/` add that new GitHub repo as a remote, labelling it `myGitHub` for git use, i.e., ``` $ git remote add myGithub https://github.com/DannyQuah/myGistProject ``` Push to the new repository on GitHub ``` $ git push myGithub master ``` Keep things parallel by renaming the remote of gist; `origin` is where this had come from, so now instead called it `myGist` ``` $ git remote rename origin myGist ``` Now each time push either to myGithub or myGist (or both, obviously): ``` $ # changes $ git commit -m "The new changes" $ git push myGithub master # to github $ git push myGist master # to gist ``` References: - [Gisto][] - [Ishu3101][] Collection [Gisto]: https://www.gistoapp.com/ [Ishu3101]: https://gist.github.com/ishu3101/830b556b487de5d69690