Skip to content

Commit

Permalink
Update Blog “assorted-git-things”
Browse files Browse the repository at this point in the history
  • Loading branch information
msfjarvis authored Dec 29, 2024
1 parent c5a7bb1 commit 38fe5ab
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions content/posts/assorted-git-things/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
+++
categories = ["dev"]
date = "2024-10-01T13:57:00+05:30"
lastmod = "2024-10-01T13:57:00+05:30"
summary = "A running log of Git concepts I've learned since I started journaling"
tags = ["git"]
title = "Assorted Git things"
date = 2024-10-01T13:57:00.000+05:30
lastmod = 2024-12-29T19:47:00.000
summary = "A running log of Git concepts I've learned since I started journaling"
categories = [ "dev" ]
tags = [ "git" ]
draft = false
+++
When I asked for suggestions about note-taking apps [back in May](https://androiddev.social/@msfjarvis/112378523734491769) I wasn't fully convinced I'd be able to stick with it, but nearly 6 months later it has probably been the thing I've been most consistent about. Anyways, here's a rather short list of Git things off the ['TIL'](https://dictionary.cambridge.org/us/dictionary/english/til) list in my Logseq graph. I'll keep adding new things to the top as they come up.

# GIT_EDITOR variable

When I asked for suggestions about note-taking apps [back in May](https://androiddev.social/@msfjarvis/112378523734491769) I wasn't fully convinced I'd be able to stick with it, but nearly 6 months later it has probably been the thing I've been most consistent about. Anyways, here's a rather short list of Git things off the ['TIL'](https://dictionary.cambridge.org/us/dictionary/english/til) list in my Logseq graph.
While Git will usually pick the `$EDITOR` environment variable to present an edit UI for commit messages and rebase to-dos, it also supports [its own `$GIT_EDITOR`](https://git-scm.com/docs/git-var#Documentation/git-var.txt-GITEDITOR) variable that can be used to set a Git-specific editor. This functionality can be leveraged from integrated terminals inside IDEs to allow writing commit message from the IDE without having to use their entire Git UI.

# `git add`

Expand All @@ -18,7 +22,7 @@ When I asked for suggestions about note-taking apps [back in May](https://androi

Probably the biggest pain in the ass in all of Git land. Every time I've had to use a submodule, I've disliked the experience. Here's how to _properly_ get rid of a submodule in case you're switching to [git-subrepo](https://github.com/ingydotnet/git-subrepo) or a different solution.

```
```plain
git submodule deinit -f path/to/module
rm -rf .git/modules/path/to/module
git config -f .gitmodules --remove-section submodule.path/to/module
Expand All @@ -42,7 +46,7 @@ While trying to configure [pass-git-helper](https://github.com/languitar/pass-gi

Git credential helpers work via writing and reading from stdin and stdout which helped me debug an issue I was having with pass-git-helper. To get a credential helper to spit out the password, it needs to be called with `get` as the first argument and pass in some basic key=value data. The interaction looks somewhat like given below, with `<` indicating the stdin of the credential helper and `>` indicating its stdout.

```
```plain
# for URL https://git.msfjarvis.dev/msfjarvis/super-private
$ pass-git-helper get
< protocol=https
Expand Down

0 comments on commit 38fe5ab

Please sign in to comment.