From d36c2e459a74ec67e523539eb98b78b95b01432a Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 16 Apr 2025 11:20:43 -0300 Subject: src/content/: Normalize [source,$lang] code blocks --- src/content/tils/2020/08/14/browse-git.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/content/tils/2020/08/14') diff --git a/src/content/tils/2020/08/14/browse-git.adoc b/src/content/tils/2020/08/14/browse-git.adoc index 3d7660e..6b3ff6d 100644 --- a/src/content/tils/2020/08/14/browse-git.adoc +++ b/src/content/tils/2020/08/14/browse-git.adoc @@ -4,7 +4,7 @@ I commonly use tools like `git log` together with `git show` when inspecting past changes in a repository: -[source,shell] +[source,sh] ---- git log # search for a the commit I'm looking for @@ -18,7 +18,7 @@ but to browse the whole repository at that specific commit. I used to accomplish it the "brute force" way: clone the whole repository in another folder and checkout the commit there: -[source,shell] +[source,sh] ---- git clone /tmp/tmp-repo-clone cd /tmp-repo-clone @@ -28,7 +28,7 @@ git checkout But git itself allows we to specific the directory of the checkout by using the `--work-tree` global git flag. This is what `man git` says about it: -[source,txt] +[source,text] ---- --work-tree= Set the path to the working tree. It can be an absolute path or a path relative to the current working @@ -40,7 +40,7 @@ But git itself allows we to specific the directory of the checkout by using the So it allows us to set the desired path of the working tree. So if we want to copy the contents of the current working tree into `copy/`: -[source,shell] +[source,sh] ---- mkdir copy git --work-tree=copy/ checkout . @@ -49,7 +49,7 @@ git --work-tree=copy/ checkout . After that `copy/` will contain a replica of the code in HEAD. But to checkout a specific, we need some extra parameters: -[source,shell] +[source,sh] ---- git --work-tree= checkout -- . ---- @@ -59,7 +59,7 @@ Morse signals to git, but we're actually saying to `git-checkout` which sub directory of `` we want to look at. Which means we can do something like: -[source,shell] +[source,sh] ---- git --work-tree= checkout -- src/ ---- -- cgit v1.2.3