Skip to content

Instantly share code, notes, and snippets.

View yongen9696's full-sized avatar
💭
(╯°□°)╯︵ssǝɹʇs

Yong yongen9696

💭
(╯°□°)╯︵ssǝɹʇs
View GitHub Profile
@yongen9696
yongen9696 / git_submodules.md
Created March 22, 2024 04:14 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@yongen9696
yongen9696 / revert-a-commit.md
Created April 18, 2023 02:49 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@yongen9696
yongen9696 / cloudSettings
Last active March 27, 2020 15:39
Created on Cognitive Class Labs
{"lastUpload":"2020-03-27T15:39:49.201Z","extensionVersion":"v3.4.3"}
@yongen9696
yongen9696 / PY0101EN-5-1-Numpy1D.ipynb
Created December 17, 2019 02:20
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongen9696
yongen9696 / PY0101EN-4-2-WriteFile.ipynb
Created December 3, 2019 02:08
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongen9696
yongen9696 / PY0101EN-4-1-ReadFile.ipynb
Created December 3, 2019 02:03
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongen9696
yongen9696 / PY0101EN-3-4-Classes.ipynb
Created December 3, 2019 01:27
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongen9696
yongen9696 / PY0101EN-3-3-Functions.ipynb
Created November 21, 2019 16:51
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongen9696
yongen9696 / PY0101EN-3-2-Loops.ipynb
Created November 21, 2019 15:56
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.