Tag git

 Like

Liked Jenniferplusplus (@jenniferplusplus@hachyderm.io)
Post details
PSA: Do not put git repos inside other git repos. Git is not a package manager. You will make yourself sad. It doesn't matter how many conceptual primitives they share. Don't do it. Just use a package manager. You don't even need a package repository. You can still download things directly from git repos if you want to. Just list them in a package.json or something, and let npm do it. Or go.mod. Anything. Please. For your own sake. And everyone who comes after you.

 Like

Liked lornajane (@lornajane@indieweb.social)
Post details
I’m pretty sure the most impactful thing I did this week was teach a colleague to git add with -p. And I feel pretty good about that. Context in case it’s useful: - p is for patch. Command ‘git add -p’ presents the user with all their unstaged changes, one chunk at a time, and prompts for whether to add it or not. This is better than using a dot to all your local changes, or having to type long file paths to pick up just a few files and ignore others. Try it!

 Note

Something cool newer #git versions are doing - you'll now see Reapply instead of Revert Revert ... in commit messages, if you're reverting a revert.

In an older version of Git (i.e. with 2.34.x) you would see:

Revert "Revert "Commit title here""
Revert "Commit title here"
Commit title here

However, in newer versions (i.e. with 2.43.x) you now see:

Reapply "Commit title here"
Revert "Commit title here"
Commit title here

Which makes it a little bit cleaner in your Git log

 Repost

Reposted lornajane (@lornajane@indieweb.social)
Post details
When you work on a project with squash-and-merge as a strategy, you end up splitting concepts across multiple pull requests to make coherent git history that could be untangled later if needed. Teams throw away the context because they have poor git commit practices, but they have poor git commit practices because they throw all that context away ...